Skip to content

Commit 182dcd3

Browse files
committed
always emit end in 0.4
1 parent 7feee19 commit 182dcd3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: lib/node-http-proxy/http-proxy.js

+5
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,12 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
266266
// already been called and the 'error' event listener
267267
// removed.
268268
//
269+
var ended = false
270+
response.on('close', function () {
271+
if(!ended) response.emit('end')
272+
})
269273
response.on('end', function () {
274+
ended = true
270275
if (!errState) {
271276
reverseProxy.removeListener('error', proxyError);
272277

0 commit comments

Comments
 (0)