diff --git a/app/steps/sendProxyRequest.js b/app/steps/sendProxyRequest.js index 854355e9..6764ecfb 100644 --- a/app/steps/sendProxyRequest.js +++ b/app/steps/sendProxyRequest.js @@ -10,7 +10,7 @@ function sendProxyRequest(Container) { return new Promise(function(resolve, reject) { var protocol = Container.proxy.requestModule; - var proxyReq = protocol.request(reqOpt, function(rsp) { + var proxyReq = Container.proxy.req = protocol.request(reqOpt, function(rsp) { if (options.stream) { Container.proxy.res = rsp; return resolve(Container); diff --git a/index.js b/index.js index ee065f4b..f8129754 100644 --- a/index.js +++ b/index.js @@ -30,11 +30,6 @@ module.exports = function proxy(host, userOptions) { debug('[start proxy] ' + req.path); var container = new ScopeContainer(req, res, next, host, userOptions); - // Skip proxy if filter is falsey. Loose equality so filters can return - // false, null, undefined, etc. - - //if (!container.options.filter(req, res)) { return next(); } - filterUserRequest(container) .then(buildProxyReq) .then(resolveProxyHost) diff --git a/lib/scopeContainer.js b/lib/scopeContainer.js index cbfaf317..2bf5b0ad 100644 --- a/lib/scopeContainer.js +++ b/lib/scopeContainer.js @@ -18,8 +18,8 @@ function Container(req, res, next, host, userOptions) { next: next, }, proxy: { - req: {}, - res: {}, + req: undefined, + res: undefined, resData: undefined, // from proxy res bodyContent: undefined, // for proxy req reqBuilder: {}, // reqOpt, intended as first arg to http(s)?.request