From 1b5cf8a2cb87f1d79449a1fc6be6ec4c4020770b Mon Sep 17 00:00:00 2001 From: Thomas Sibley Date: Mon, 22 Apr 2024 11:36:08 -0700 Subject: [PATCH] fix: request cache mode is not the same as request mode Noticed while reading thru the code. --- lib/web/fetch/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/fetch/index.js b/lib/web/fetch/index.js index f0a4cf70f08..a082797e575 100644 --- a/lib/web/fetch/index.js +++ b/lib/web/fetch/index.js @@ -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 } @@ -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') }