Skip to content

Commit 1204a35

Browse files
committed
[fix] support buffer
1 parent f720e36 commit 1204a35

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/http-proxy/passes/web-incoming.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ web_o = Object.keys(web_o).map(function(pass) {
9595
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
9696
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
9797
);
98-
req.pipe(forwardReq);
98+
(options.buffer || req).pipe(forwardReq);
9999
return res.end();
100100
}
101101

@@ -114,7 +114,7 @@ web_o = Object.keys(web_o).map(function(pass) {
114114
}
115115
});
116116

117-
req.pipe(proxyReq);
117+
(options.buffer || req).pipe(proxyReq);
118118

119119
proxyReq.on('response', function(proxyRes) {
120120
for(var i=0; i < web_o.length; i++) {
@@ -124,10 +124,6 @@ web_o = Object.keys(web_o).map(function(pass) {
124124
proxyRes.pipe(res);
125125
});
126126

127-
if(options.buffer) {
128-
options.buffer.resume();
129-
}
130-
131127
//proxyReq.end();
132128
}
133129

0 commit comments

Comments
 (0)