1
0
Fork 0
forked from svrjs/svrjs

Change proxy handler to end the socket with 500 Internal Server Error only when it is not destroyed.

This commit is contained in:
Dorian Niemiec 2024-08-25 12:55:34 +02:00
parent 5b91c21973
commit b79e165bed

View file

@ -55,7 +55,7 @@ function proxyHandler(req, socket, head) {
); );
logFacilities.errmessage("Stack:"); logFacilities.errmessage("Stack:");
logFacilities.errmessage(err.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 { } else {
logFacilities.errmessage("SVR.JS doesn't support proxy without proxy mod."); logFacilities.errmessage("SVR.JS doesn't support proxy without proxy mod.");