Skip to content

Commit ee3506a

Browse files
committed
Updating to enableXForwarded
1 parent 404818b commit ee3506a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/node-http-proxy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ HttpProxy.prototype.close = function () {
328328
// options.host {string} Host of the proxy target.
329329
// options.buffer {Object} Result from `httpProxy.buffer(req)`
330330
// 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.
332332
//
333333
HttpProxy.prototype.proxyRequest = function (req, res, options) {
334334
var self = this, errState = false, location, outgoing, protocol, reverseProxy;
@@ -341,7 +341,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
341341
options = options || {};
342342
options.host = options.host || this.target.host;
343343
options.port = options.port || this.target.port;
344-
options.allow_xforwarded_headers = options.allow_xforwarded_headers || false;
344+
options.enableXForwarded = options.enableXForwarded || false;
345345

346346
//
347347
// Check the proxy table for this instance to see if we need
@@ -381,7 +381,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
381381
// * `x-forwarded-proto`: Protocol of the original request
382382
// * `x-forwarded-port`: Port of the original request.
383383
//
384-
if (options.allow_xforwarded_headers == true) {
384+
if (options.enableXForwarded == true) {
385385
req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.connection.socket.remoteAddress;
386386
req.headers['x-forwarded-port'] = req.connection.remotePort || req.connection.socket.remotePort;
387387
req.headers['x-forwarded-proto'] = res.connection.pair ? 'https' : 'http';

0 commit comments

Comments
 (0)