From b79e165bedcf8657e81bc4a61970cbbc78977eba Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 25 Aug 2024 12:55:34 +0200 Subject: [PATCH] Change proxy handler to end the socket with 500 Internal Server Error only when it is not destroyed. --- src/handlers/proxyHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/proxyHandler.js b/src/handlers/proxyHandler.js index d0e0420..7027e51 100644 --- a/src/handlers/proxyHandler.js +++ b/src/handlers/proxyHandler.js @@ -55,7 +55,7 @@ function proxyHandler(req, socket, head) { ); logFacilities.errmessage("Stack:"); logFacilities.errmessage(err.stack); - socket.end("HTTP/1.1 500 Internal Server Error\n\n"); + if (!socket.destroyed) socket.end("HTTP/1.1 500 Internal Server Error\n\n"); } } else { logFacilities.errmessage("SVR.JS doesn't support proxy without proxy mod.");