[fix] Don't remove error listener after response ends

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.
This commit is contained in:
Maciej Małecki 2012-12-23 00:44:21 +01:00
parent edfe869159
commit 223eacda85

View File

@ -271,8 +271,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
response.on('end', function () { response.on('end', function () {
ended = true; ended = true;
if (!errState) { if (!errState) {
reverseProxy.removeListener('error', proxyError);
try { res.end() } try { res.end() }
catch (ex) { console.error("res.end error: %s", ex.message) } catch (ex) { console.error("res.end error: %s", ex.message) }