From e3d95ecab24700535184df32f3a97e8699099b7f Mon Sep 17 00:00:00 2001 From: Dominic Tarr Date: Thu, 21 Jul 2011 23:53:25 +1000 Subject: [PATCH] [minor] default enableXForwarded to true --- lib/node-http-proxy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index c9dbec5..4c53063 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -341,7 +341,8 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) { options = options || {}; options.host = options.host || this.target.host; options.port = options.port || this.target.port; - options.enableXForwarded = options.enableXForwarded || false; + options.enableXForwarded = + (undefined === options.enableXForwarded ? true : options.enableXForwarded); // // Check the proxy table for this instance to see if we need @@ -589,8 +590,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options options = options || {}; options.host = options.host || this.target.host; - options.port = options.port || this.target.port; // - + options.port = options.port || this.target.port; + if (this.proxyTable && !options.host) { location = this.proxyTable.getProxyLocation(req);