Skip to content

Commit 82da853

Browse files
committed
Merge pull request http-party#285 from 1stvamp/pass-change-origin-from-routing-proxy
If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy
2 parents 24b8406 + 89459bf commit 82da853

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/node-http-proxy/routing-proxy.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) {
5151
this.https = this.source.https || options.https;
5252
this.enable = options.enable;
5353
this.forward = options.forward;
54+
this.changeOrigin = options.changeOrigin || false;
5455

5556
//
5657
// Listen for 'newListener' events so that we can bind 'proxyError'
@@ -94,7 +95,7 @@ RoutingProxy.prototype.add = function (options) {
9495
// Setup options to pass-thru to the new `HttpProxy` instance
9596
// for the specified `options.host` and `options.port` pair.
9697
//
97-
['https', 'enable', 'forward'].forEach(function (key) {
98+
['https', 'enable', 'forward', 'changeOrigin'].forEach(function (key) {
9899
if (options[key] !== false && self[key]) {
99100
options[key] = self[key];
100101
}
@@ -281,4 +282,4 @@ RoutingProxy.prototype._getKey = function (options) {
281282
options.host || options.target.host,
282283
options.port || options.target.port
283284
].join(':');
284-
};
285+
};

0 commit comments

Comments
 (0)