From 40c66437db35968742d90f951220af5f04fcea9b Mon Sep 17 00:00:00 2001 From: Brecht Cloetens Date: Sun, 23 Apr 2023 20:35:59 +0200 Subject: [PATCH] Update web-incoming.js When req.socket is undefined a type error occured, this error is fixed within this pull request. Fixed error - uncaughtException: TypeError: Cannot read properties of undefined (reading 'destroyed') --- 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..022ca4bf8 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.socket?.destroyed && err.code === 'ECONNRESET') { server.emit('econnreset', err, req, res, url); return proxyReq.abort(); }