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; writtenStatusCode = statusCode;
res.setHeader("X-SVRJS-Cache", "MISS"); res.setHeader("X-SVRJS-Cache", "MISS");
if (headers) { if (headers || typeof statusCodeDescription !== "object") {
originalWriteHead( originalWriteHead(
writtenStatusCode, writtenStatusCode,
statusCodeDescription, statusCodeDescription,