From ecd771e45a4b884f9ee163cbb62cd0bc763c8630 Mon Sep 17 00:00:00 2001 From: Roderik van der Veer Date: Thu, 25 Nov 2021 14:55:30 +0100 Subject: [PATCH] backport https://github.com/http-party/node-http-proxy/pull/1542 --- lib/http-proxy/passes/web-incoming.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index 7ae735514..8fd5faf00 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -154,7 +154,7 @@ module.exports = { function createErrorHandler(proxyReq, url) { return function proxyError(err) { - if (req.socket.destroyed && err.code === 'ECONNRESET') { + if (req.aborted && err.code === 'ECONNRESET') { server.emit('econnreset', err, req, res, url); return proxyReq.abort(); }