proxy-addr
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -0,1 +1,6 @@ | ||
1.0.3 / 2014-09-21 | ||
================== | ||
* Use `forwarded` npm module | ||
1.0.2 / 2014-09-18 | ||
@@ -2,0 +7,0 @@ ================== |
13
index.js
@@ -19,2 +19,3 @@ /*! | ||
var forwarded = require('forwarded'); | ||
var ipaddr = require('ipaddr.js'); | ||
@@ -50,13 +51,5 @@ | ||
function alladdrs(req, trust) { | ||
if (!req) { | ||
throw new TypeError('req argument is required'); | ||
} | ||
// get addresses | ||
var addrs = forwarded(req); | ||
var proxyAddrs = (req.headers['x-forwarded-for'] || '') | ||
.split(/ *, */) | ||
.filter(Boolean) | ||
.reverse(); | ||
var socketAddr = req.connection.remoteAddress; | ||
var addrs = [socketAddr].concat(proxyAddrs); | ||
if (!trust) { | ||
@@ -63,0 +56,0 @@ // Return all addresses |
{ | ||
"name": "proxy-addr", | ||
"description": "Determine address of proxied request", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
@@ -14,2 +14,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"forwarded": "~0.1.0", | ||
"ipaddr.js": "0.1.3" | ||
@@ -16,0 +17,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
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
13086
2
276
+ Addedforwarded@~0.1.0
+ Addedforwarded@0.1.2(transitive)