Skip to content
Browse files

always emit end in 0.4

  • Loading branch information...
1 parent 7feee19 commit 182dcd34555f361c1bb2b8d2777689e64ce32f87 @dominictarr dominictarr committed Nov 10, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/node-http-proxy/http-proxy.js
View
5 lib/node-http-proxy/http-proxy.js
@@ -266,7 +266,12 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
// already been called and the 'error' event listener
// removed.
//
+ var ended = false
+ response.on('close', function () {
+ if(!ended) response.emit('end')
+ })
response.on('end', function () {
+ ended = true
if (!errState) {
reverseProxy.removeListener('error', proxyError);

0 comments on commit 182dcd3

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