fix: set written status code and X-SVRJS-Cache header when no header is passed to res.writeHead()

This commit is contained in:
Dorian Niemiec 2024-12-19 22:35:13 +01:00
parent ed53ea2061
commit fc4b89c6bd

View file

@ -81,9 +81,9 @@ module.exports = function (req, res, logFacilities, config, next) {
Object.keys(properHeaders).forEach((key) => {
writtenHeaders[key.toLowerCase()] = properHeaders[key];
});
writtenStatusCode = statusCode;
res.setHeader("X-SVRJS-Cache", "MISS");
}
writtenStatusCode = statusCode;
res.setHeader("X-SVRJS-Cache", "MISS");
if (headers) {
originalWriteHead(
writtenStatusCode,