From b8d742c9831b545fd959a045b3831e7046c252bd Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Thu, 19 Dec 2024 22:42:06 +0100 Subject: [PATCH] fix: write HTTP status code message when the second property of res.writeHead isn't an object --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4c0502d..55b920c 100644 --- a/src/index.js +++ b/src/index.js @@ -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,