Log ip
This commit is contained in:
parent
6ed427658e
commit
d81195856a
|
@ -69,7 +69,8 @@ DocumentHandler.prototype.handlePost = function (request, response) {
|
||||||
_this.chooseKey(function (key) {
|
_this.chooseKey(function (key) {
|
||||||
_this.store.set(key, buffer, function (res) {
|
_this.store.set(key, buffer, function (res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
winston.verbose('added document', { key: key });
|
var ip = request.headers['X-Forwarded-For'] || request.ip;
|
||||||
|
winston.verbose('added document', { key: key, ip: ip });
|
||||||
response.writeHead(200, { 'content-type': 'application/json' });
|
response.writeHead(200, { 'content-type': 'application/json' });
|
||||||
response.end(JSON.stringify({ key: key }));
|
response.end(JSON.stringify({ key: key }));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue