Do not cache Set-Cookie headers

This commit is contained in:
D. Berge
2023-09-14 13:13:47 +02:00
parent 597d407acc
commit 33618b6b82

View File

@@ -33,7 +33,9 @@ function saveResponse (res) {
const cache = getCache(res); const cache = getCache(res);
const req = res.req; const req = res.req;
console.log(`Saving ETag: ${req.method} ${req.url}${etag}`); console.log(`Saving ETag: ${req.method} ${req.url}${etag}`);
cache[req.url] = {etag, headers: res.getHeaders()}; const headers = res.getHeaders();
delete headers["set-cookie"];
cache[req.url] = {etag, headers};
} }
} }
}; };