From 89459bfd32bec302fa259c4ccefa70d6bf1794e2 Mon Sep 17 00:00:00 2001 From: Wesley Mason Date: Wed, 25 Jul 2012 14:17:48 +0100 Subject: [PATCH] If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy --- lib/node-http-proxy/routing-proxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/node-http-proxy/routing-proxy.js b/lib/node-http-proxy/routing-proxy.js index cf4916b82..187cb4220 100644 --- a/lib/node-http-proxy/routing-proxy.js +++ b/lib/node-http-proxy/routing-proxy.js @@ -51,6 +51,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) { this.https = this.source.https || options.https; this.enable = options.enable; this.forward = options.forward; + this.changeOrigin = options.changeOrigin || false; // // Listen for 'newListener' events so that we can bind 'proxyError' @@ -94,7 +95,7 @@ RoutingProxy.prototype.add = function (options) { // Setup options to pass-thru to the new `HttpProxy` instance // for the specified `options.host` and `options.port` pair. // - ['https', 'enable', 'forward'].forEach(function (key) { + ['https', 'enable', 'forward', 'changeOrigin'].forEach(function (key) { if (options[key] !== false && self[key]) { options[key] = self[key]; } @@ -281,4 +282,4 @@ RoutingProxy.prototype._getKey = function (options) { options.host || options.target.host, options.port || options.target.port ].join(':'); -}; \ No newline at end of file +};