Comparing version 1.3.1 to 1.3.2
@@ -0,5 +1,10 @@ | ||
1.3.2 / 2014-09-27 | ||
================== | ||
* Fix `req.ip` integration when `immediate: false` | ||
1.3.1 / 2014-09-14 | ||
================== | ||
* Remove us-used `bytes` dependency | ||
* Remove un-used `bytes` dependency | ||
* deps: depd@0.4.5 | ||
@@ -6,0 +11,0 @@ |
19
index.js
@@ -95,3 +95,3 @@ /*! | ||
req._startTime = new Date; | ||
req._remoteAddress = req.connection && req.connection.remoteAddress; | ||
req._remoteAddress = getip(req); | ||
@@ -274,8 +274,3 @@ function logRequest(){ | ||
exports.token('remote-addr', function(req){ | ||
if (req.ip) return req.ip; | ||
if (req._remoteAddress) return req._remoteAddress; | ||
if (req.connection) return req.connection.remoteAddress; | ||
return undefined; | ||
}); | ||
exports.token('remote-addr', getip); | ||
@@ -324,1 +319,11 @@ /** | ||
/** | ||
* Get request IP address. | ||
*/ | ||
function getip(req) { | ||
return req.ip | ||
|| req._remoteAddress | ||
|| (req.connection && req.connection.remoteAddress) | ||
|| undefined; | ||
} |
{ | ||
"name": "morgan", | ||
"description": "http request logger middleware for node.js", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15321
254