diff --git a/svr.js b/svr.js index c999286..40734fd 100644 --- a/svr.js +++ b/svr.js @@ -2950,12 +2950,9 @@ if (!cluster.isPrimary) { if (!req.protocol) req.protocol = req.headers[":scheme"]; if (!req.method) req.method = req.headers[":method"]; if (req.headers[":path"] == undefined || req.headers[":method"] == undefined) { - var cheaders = getCustomHeaders(); - cheaders["Content-Type"] = "text/html; charset=utf-8"; - res.writeHead(400, "Bad Request", cheaders); - res.write("
The request you sent is invalid.
" + (exposeServerVersion ? "SVR.JS/" + version + " (" + getOS() + "; " + (process.isBun ? ("Bun/v" + process.versions.bun + "; like Node.JS/" + process.version) : ("Node.JS/" + process.version)) + ")" : "SVR.JS").replace(/&/g, "&").replace(//g, ">") + (req.headers[":authority"] == undefined ? "" : " on " + req.headers[":authority"]) + "
"); - res.end(); - return; + var err = new Error("Either \":path\" or \":method\" pseudoheader is missing."); + if(Buffer.alloc) err.rawPacket = Buffer.alloc(0); + reqerrhandler(err, req.socket, fromMain); } }