chore: release SVR.JS Cache mod 1.0.1

This commit is contained in:
Dorian Niemiec 2024-12-19 22:43:09 +01:00
parent 087a4a7a9b
commit 5b4f2a0983
2 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{
"name": "SVR.JS Cache mod",
"version": "1.0.0"
"version": "1.0.1"
}

View file

@ -77,12 +77,14 @@ module.exports = function (req, res, logFacilities, config, next) {
res.writeHead = function (statusCode, statusCodeDescription, headers) {
const properHeaders = headers ? headers : statusCodeDescription;
if (typeof properHeaders === "object" && properHeaders !== null) {
Object.keys(properHeaders).forEach((key) => {
writtenHeaders[key.toLowerCase()] = properHeaders[key];
});
}
writtenStatusCode = statusCode;
res.setHeader("X-SVRJS-Cache", "MISS");
if (headers) {
if (headers || typeof statusCodeDescription !== "object") {
originalWriteHead(
writtenStatusCode,
statusCodeDescription,