Skip to content

Commit 223eacd

Browse files
committed
[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.
1 parent edfe869 commit 223eacd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/node-http-proxy/http-proxy.js

-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
271271
response.on('end', function () {
272272
ended = true;
273273
if (!errState) {
274-
reverseProxy.removeListener('error', proxyError);
275-
276274
try { res.end() }
277275
catch (ex) { console.error("res.end error: %s", ex.message) }
278276

0 commit comments

Comments
 (0)