Skip to content

Commit ad94d32

Browse files
authored
381 (#386)
* [#381] Fixes proxyReq is empty ({}) in userResHeaderDecorator. * Remove old comment.
1 parent 338c6d8 commit ad94d32

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

app/steps/sendProxyRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function sendProxyRequest(Container) {
1010

1111
return new Promise(function(resolve, reject) {
1212
var protocol = Container.proxy.requestModule;
13-
var proxyReq = protocol.request(reqOpt, function(rsp) {
13+
var proxyReq = Container.proxy.req = protocol.request(reqOpt, function(rsp) {
1414
if (options.stream) {
1515
Container.proxy.res = rsp;
1616
return resolve(Container);

index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ module.exports = function proxy(host, userOptions) {
3030
debug('[start proxy] ' + req.path);
3131
var container = new ScopeContainer(req, res, next, host, userOptions);
3232

33-
// Skip proxy if filter is falsey. Loose equality so filters can return
34-
// false, null, undefined, etc.
35-
36-
//if (!container.options.filter(req, res)) { return next(); }
37-
3833
filterUserRequest(container)
3934
.then(buildProxyReq)
4035
.then(resolveProxyHost)

lib/scopeContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function Container(req, res, next, host, userOptions) {
1818
next: next,
1919
},
2020
proxy: {
21-
req: {},
22-
res: {},
21+
req: undefined,
22+
res: undefined,
2323
resData: undefined, // from proxy res
2424
bodyContent: undefined, // for proxy req
2525
reqBuilder: {}, // reqOpt, intended as first arg to http(s)?.request

0 commit comments

Comments
 (0)