Skip to content

Commit

Permalink
fix: explicitly set cache to default
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 20, 2020
1 parent 3ce5d1c commit dcb519f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/workbox/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function runtimeCaching(workbox, options) {
const requestInterceptor = {
requestWillFetch({ request }) {
if (request.cache === 'only-if-cached' && request.mode === 'no-cors') {
return new Request(request.url, { ...request, mode: 'no-cors' })
return new Request(request.url, { ...request, cache: 'default', mode: 'no-cors' })
}
return request
},
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/pwa.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function runtimeCaching(workbox, options) {
const requestInterceptor = {
requestWillFetch({ request }) {
if (request.cache === 'only-if-cached' && request.mode === 'no-cors') {
return new Request(request.url, { ...request, mode: 'no-cors' })
return new Request(request.url, { ...request, cache: 'default', mode: 'no-cors' })
}
return request
},
Expand Down

0 comments on commit dcb519f

Please # to comment.