mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:17:08 +00:00
Save a copy of the headers not the original.
Otherwise ExpressJS will complain about trying to modify headers that have already been sent.
This commit is contained in:
@@ -33,7 +33,7 @@ function saveResponse (res) {
|
||||
const cache = getCache(res);
|
||||
const req = res.req;
|
||||
console.log(`Saving ETag: ${req.method} ${req.url} → ${etag}`);
|
||||
const headers = res.getHeaders();
|
||||
const headers = structuredClone(res.getHeaders());
|
||||
delete headers["set-cookie"];
|
||||
cache[req.url] = {etag, headers};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user