proxy
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -130,4 +130,6 @@ "use strict"; | ||
hasXForwardedFor = true; | ||
value += ', ' + socket.remoteAddress; | ||
debug.proxyRequest('appending to existing "%s" header: "%s"', key, value); | ||
if (typeof socket.remoteAddress === 'string') { | ||
value += ', ' + socket.remoteAddress; | ||
debug.proxyRequest('appending to existing "%s" header: "%s"', key, value); | ||
} | ||
} | ||
@@ -158,3 +160,3 @@ if (!hasVia && 'via' === keyLower) { | ||
// http://en.wikipedia.org/wiki/X-Forwarded-For | ||
if (!hasXForwardedFor) { | ||
if (!hasXForwardedFor && typeof socket.remoteAddress === 'string') { | ||
headers['X-Forwarded-For'] = socket.remoteAddress; | ||
@@ -194,3 +196,3 @@ debug.proxyRequest('adding new "X-Forwarded-For" header: "%s"', headers['X-Forwarded-For']); | ||
headers, | ||
localAddress: this.localAddress | ||
localAddress: this.localAddress, | ||
}); | ||
@@ -197,0 +199,0 @@ debug.proxyRequest('%s %s HTTP/1.1 ', proxyReq.method, proxyReq.path); |
@@ -130,4 +130,6 @@ "use strict"; | ||
hasXForwardedFor = true; | ||
value += ', ' + socket.remoteAddress; | ||
debug.proxyRequest('appending to existing "%s" header: "%s"', key, value); | ||
if (typeof socket.remoteAddress === 'string') { | ||
value += ', ' + socket.remoteAddress; | ||
debug.proxyRequest('appending to existing "%s" header: "%s"', key, value); | ||
} | ||
} | ||
@@ -158,3 +160,3 @@ if (!hasVia && 'via' === keyLower) { | ||
// http://en.wikipedia.org/wiki/X-Forwarded-For | ||
if (!hasXForwardedFor) { | ||
if (!hasXForwardedFor && typeof socket.remoteAddress === 'string') { | ||
headers['X-Forwarded-For'] = socket.remoteAddress; | ||
@@ -194,3 +196,3 @@ debug.proxyRequest('adding new "X-Forwarded-For" header: "%s"', headers['X-Forwarded-For']); | ||
headers, | ||
localAddress: this.localAddress | ||
localAddress: this.localAddress, | ||
}); | ||
@@ -197,0 +199,0 @@ debug.proxyRequest('%s %s HTTP/1.1 ', proxyReq.method, proxyReq.path); |
{ | ||
"name": "proxy", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "An HTTP proxy written with Node.js (think Squid)", | ||
@@ -5,0 +5,0 @@ "main": "./dist/proxy.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51468
898