request-stats
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -32,5 +32,3 @@ 'use strict' | ||
var bytesWrittenDelta = req.connection.bytesWritten - bytesWrittenPreviously | ||
var ip = req.headers['x-forwarded-for'] || req.connection | ||
? req.connection.remoteAddress | ||
: req.socket ? req.socket.remoteAddress : req.connection.socket.remoteAddress | ||
var ip = getIp(req) | ||
@@ -66,4 +64,15 @@ req.connection._requestStats = { | ||
function getIp (req) { | ||
var ip = req.headers['x-forwarded-for'] | ||
if (!ip) { | ||
ip = req.connection && req.connection.remoteAddress | ||
if (!ip && req.socket) { | ||
ip = req.socket.remoteAddress || (req.socket.connection && req.socket.connection.remoteAddress) | ||
} | ||
} | ||
return ip | ||
} | ||
StatsEmitter.prototype._attach = function (listener) { | ||
if (typeof listener === 'function') this.on('complete', listener) | ||
} |
{ | ||
"name": "request-stats", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Get stats on your Node.js HTTP server requests", | ||
@@ -39,5 +39,5 @@ "main": "index.js", | ||
"coordinates": [ | ||
55.6810207, | ||
12.5644253 | ||
55.7775770796403, | ||
12.59000686560671 | ||
] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20793
375
3