Permalink
Browse files

[minor] default enableXForwarded to true

  • Loading branch information...
1 parent 5d33ad7 commit e3d95ecab24700535184df32f3a97e8699099b7f @dominictarr dominictarr committed Jul 21, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 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);

0 comments on commit e3d95ec

Please sign in to comment.