Skip to content

Commit

Permalink
always emit end in 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Nov 10, 2011
1 parent 7feee19 commit 182dcd3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 182dcd3

Please sign in to comment.