Fixed FastCGI connections not closing properly, when SVR.JS is running on Bun

This commit is contained in:
Dorian Niemiec 2024-05-01 16:51:14 +02:00
parent 3b3a29009b
commit 7c4121c55d

View file

@ -182,6 +182,11 @@ function createFastCGIHandler(options) {
if (typeof socket !== "undefined") {
socket.removeListener("data", fastCGISocketHandler);
processFastCGIPacket = function() {};
try {
socket.end(); //Fixes connection not closing properly in Bun
} catch (err) {
//It is already closed
}
}
var appStatus = processedPacket.content.readUInt32BE(0);
var protocolStatus = processedPacket.content.readUInt8(4);