Skip to content

Commit

Permalink
[fix] Don't remove error listener after response ends
Browse files Browse the repository at this point in the history
In some rare cases, `error` event might still be emitted after the
response has ended. This is (most likely) a bug in the `node` core.
  • Loading branch information
mmalecki committed Dec 22, 2012
1 parent edfe869 commit 223eacd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
response.on('end', function () {
ended = true;
if (!errState) {
reverseProxy.removeListener('error', proxyError);

try { res.end() }
catch (ex) { console.error("res.end error: %s", ex.message) }

Expand Down

0 comments on commit 223eacd

Please sign in to comment.