fix: write HTTP status code message when the second property of res.writeHead isn't an object

This commit is contained in:
Dorian Niemiec 2024-12-19 22:42:06 +01:00
parent fc4b89c6bd
commit b8d742c983

View file

@ -84,7 +84,7 @@ module.exports = function (req, res, logFacilities, config, next) {
}
writtenStatusCode = statusCode;
res.setHeader("X-SVRJS-Cache", "MISS");
if (headers) {
if (headers || typeof statusCodeDescription !== "object") {
originalWriteHead(
writtenStatusCode,
statusCodeDescription,