@@ -328,7 +328,7 @@ HttpProxy.prototype.close = function () {
328
328
// options.host {string} Host of the proxy target.
329
329
// options.buffer {Object} Result from `httpProxy.buffer(req)`
330
330
// options.https {Object|boolean} Settings for https.
331
- // options.allow_xforwarded_headers {boolean} Don't clobber x-forwarded headers to allow layered proxies.
331
+ // options.enableXForwarded {boolean} Don't clobber x-forwarded headers to allow layered proxies.
332
332
//
333
333
HttpProxy . prototype . proxyRequest = function ( req , res , options ) {
334
334
var self = this , errState = false , location , outgoing , protocol , reverseProxy ;
@@ -341,7 +341,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
341
341
options = options || { } ;
342
342
options . host = options . host || this . target . host ;
343
343
options . port = options . port || this . target . port ;
344
- options . allow_xforwarded_headers = options . allow_xforwarded_headers || false ;
344
+ options . enableXForwarded = options . enableXForwarded || false ;
345
345
346
346
//
347
347
// Check the proxy table for this instance to see if we need
@@ -381,7 +381,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
381
381
// * `x-forwarded-proto`: Protocol of the original request
382
382
// * `x-forwarded-port`: Port of the original request.
383
383
//
384
- if ( options . allow_xforwarded_headers == true ) {
384
+ if ( options . enableXForwarded == true ) {
385
385
req . headers [ 'x-forwarded-for' ] = req . connection . remoteAddress || req . connection . socket . remoteAddress ;
386
386
req . headers [ 'x-forwarded-port' ] = req . connection . remotePort || req . connection . socket . remotePort ;
387
387
req . headers [ 'x-forwarded-proto' ] = res . connection . pair ? 'https' : 'http' ;
0 commit comments