Comparing version 1.0.0 to 1.0.1
module.exports = function addr(req, proxies) { | ||
if (!req.headers['x-forwarded-for']) { | ||
return req.connection.remoteAddress; | ||
return req.connection._peername && req.connection._peername.address || req.connection.remoteAddress; | ||
} | ||
@@ -12,5 +12,5 @@ if (typeof proxies === 'string') { | ||
// source. | ||
return req.connection.remoteAddress; | ||
return req.connection._peername && req.connection._peername.address || req.connection.remoteAddress; | ||
} | ||
return req.headers['x-forwarded-for'].split(/\s?,\s?/).shift(); | ||
}; |
{ | ||
"name": "addr", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Get the remote address of a request, with reverse-proxy support", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,4 @@ addr | ||
[![build status](https://secure.travis-ci.org/carlos8f/node-addr.png)](http://travis-ci.org/carlos8f/node-addr) | ||
Usage | ||
@@ -8,0 +10,0 @@ ===== |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
3865
8
46
0
3