Skip to content

Commit e3d95ec

Browse files
committed
[minor] default enableXForwarded to true
1 parent 5d33ad7 commit e3d95ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/node-http-proxy.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ 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.enableXForwarded = options.enableXForwarded || false;
344+
options.enableXForwarded =
345+
(undefined === options.enableXForwarded ? true : options.enableXForwarded);
345346

346347
//
347348
// Check the proxy table for this instance to see if we need
@@ -589,8 +590,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, options
589590

590591
options = options || {};
591592
options.host = options.host || this.target.host;
592-
options.port = options.port || this.target.port; //
593-
593+
options.port = options.port || this.target.port;
594+
594595
if (this.proxyTable && !options.host) {
595596
location = this.proxyTable.getProxyLocation(req);
596597

0 commit comments

Comments
 (0)