Skip to content

Commit

Permalink
381 (#386)
Browse files Browse the repository at this point in the history
* [#381] Fixes proxyReq is empty ({}) in userResHeaderDecorator.

* Remove old comment.
  • Loading branch information
monkpow committed Oct 24, 2018
1 parent 338c6d8 commit ad94d32
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/steps/sendProxyRequest.js
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions index.js
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/scopeContainer.js
Expand Up @@ -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
Expand Down

0 comments on commit ad94d32

Please sign in to comment.