Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy #285

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/node-http-proxy/routing-proxy.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) {
this.https = this.source.https || options.https; this.https = this.source.https || options.https;
this.enable = options.enable; this.enable = options.enable;
this.forward = options.forward; this.forward = options.forward;
this.changeOrigin = options.changeOrigin || false;


// //
// Listen for 'newListener' events so that we can bind 'proxyError' // Listen for 'newListener' events so that we can bind 'proxyError'
Expand Down Expand Up @@ -94,7 +95,7 @@ RoutingProxy.prototype.add = function (options) {
// Setup options to pass-thru to the new `HttpProxy` instance // Setup options to pass-thru to the new `HttpProxy` instance
// for the specified `options.host` and `options.port` pair. // 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]) { if (options[key] !== false && self[key]) {
options[key] = self[key]; options[key] = self[key];
} }
Expand Down Expand Up @@ -281,4 +282,4 @@ RoutingProxy.prototype._getKey = function (options) {
options.host || options.target.host, options.host || options.target.host,
options.port || options.target.port options.port || options.target.port
].join(':'); ].join(':');
}; };