chore: release SVR.JS Cache mod 1.0.1
This commit is contained in:
parent
087a4a7a9b
commit
5b4f2a0983
2 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "SVR.JS Cache mod",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.1"
|
||||
}
|
||||
|
|
10
src/index.js
10
src/index.js
|
@ -77,12 +77,14 @@ module.exports = function (req, res, logFacilities, config, next) {
|
|||
|
||||
res.writeHead = function (statusCode, statusCodeDescription, headers) {
|
||||
const properHeaders = headers ? headers : statusCodeDescription;
|
||||
Object.keys(properHeaders).forEach((key) => {
|
||||
writtenHeaders[key.toLowerCase()] = properHeaders[key];
|
||||
});
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue