Skip to content

Commit

Permalink
fix: request cache mode is not the same as request mode (#3151)
Browse files Browse the repository at this point in the history
Noticed while reading thru the code.
  • Loading branch information
tsibley authored Apr 24, 2024
1 parent c0a0bb5 commit ef1b53b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/web/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ async function httpNetworkOrCacheFetch (

// 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
// then:
if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {
// TODO: cache
}

Expand All @@ -1548,7 +1548,7 @@ async function httpNetworkOrCacheFetch (
if (response == null) {
// 1. If httpRequest’s cache mode is "only-if-cached", then return a
// network error.
if (httpRequest.mode === 'only-if-cached') {
if (httpRequest.cache === 'only-if-cached') {
return makeNetworkError('only if cached')
}

Expand Down

0 comments on commit ef1b53b

Please sign in to comment.