Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@1stvamp

We use a standalone httpProxy.RoutingProxy instance inside our app to handle adhoc HTTP proxy requests. The changeOrigin option re-added in 0.8.2 isn't passed through to httpProxy.HttpProxy instances when passed to routing proxy instances, so I've tried to match the current way options are passed on in this patch.

@indexzero
Owner

lgtm

@indexzero indexzero merged commit 82da853 into nodejitsu:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 25, 2012
  1. @1stvamp
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/node-http-proxy/routing-proxy.js
View
5 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(':');
-};
+};
Something went wrong with that request. Please try again.