Skip to content
Browse files

Updating to default to true.

  • Loading branch information...
1 parent ee3506a commit 22ce60961d974bbce08b22c9dca99b392b266746 @DanBUK committed Jul 22, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-http-proxy.js
View
4 lib/node-http-proxy.js
@@ -341,7 +341,7 @@ 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 = options.enableXForwarded === true;
//
// Check the proxy table for this instance to see if we need
@@ -381,7 +381,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, options) {
// * `x-forwarded-proto`: Protocol of the original request
// * `x-forwarded-port`: Port of the original request.
//
- if (options.enableXForwarded == true) {
+ if (options.enableXForwarded === true) {
req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.connection.socket.remoteAddress;
req.headers['x-forwarded-port'] = req.connection.remotePort || req.connection.socket.remotePort;
req.headers['x-forwarded-proto'] = res.connection.pair ? 'https' : 'http';

0 comments on commit 22ce609

Please sign in to comment.
Something went wrong with that request. Please try again.