Skip to content

Commit

Permalink
chore: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 2, 2023
1 parent 179846c commit 0ff72e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ export function defineCachedEventHandler<

// Collect cachable headers
const headers = event.node.res.getHeaders();
headers.etag = headers.Etag || headers.etag || `W/"${hash(body)}"`;
headers.etag =
String(headers.Etag || headers.etag) || `W/"${hash(body)}"`;
headers["last-modified"] =
headers["Last-Modified"] ||
headers["last-modified"] ||
String(headers["Last-Modified"] || headers["last-modified"]) ||
new Date().toUTCString();
const cacheControl = [];
if (opts.swr) {
Expand Down

0 comments on commit 0ff72e2

Please sign in to comment.