Skip to content

Commit

Permalink
fix(cache): validate entry.value to have value for cached handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 18, 2023
1 parent f4e3333 commit 8455938
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ export function defineCachedEventHandler<
return [_hashedPath, ..._headers].join(":");
},
validate: (entry) => {
if (!entry.value) {
return false;
}
if (entry.value.code >= 400) {
return false;
}
Expand Down

0 comments on commit 8455938

Please sign in to comment.