Skip to content
This repository
Browse code

always emit end in 0.4

  • Loading branch information...
commit 182dcd34555f361c1bb2b8d2777689e64ce32f87 1 parent 7feee19
Dominic Tarr dominictarr authored

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. +5 0 lib/node-http-proxy/http-proxy.js
5 lib/node-http-proxy/http-proxy.js
@@ -266,7 +266,12 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
266 266 // already been called and the 'error' event listener
267 267 // removed.
268 268 //
  269 + var ended = false
  270 + response.on('close', function () {
  271 + if(!ended) response.emit('end')
  272 + })
269 273 response.on('end', function () {
  274 + ended = true
270 275 if (!errState) {
271 276 reverseProxy.removeListener('error', proxyError);
272 277

0 comments on commit 182dcd3

Please sign in to comment.
Something went wrong with that request. Please try again.