sw: restore origin check

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/953/head
Varun Patil 2023-11-25 13:19:29 -08:00
parent 81c8fc3049
commit 764505b039
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ const cachefirst = [
// Cache static file assets
registerRoute(
({ url }) => cachefirst.some((regex) => regex.test(url.pathname)),
({ url }) => url.origin === self.location.origin && cachefirst.some((regex) => regex.test(url.pathname)),
new CacheFirst({
cacheName: 'memories-pages',
plugins: [
@ -61,7 +61,7 @@ const netonly = [
// Use NetworkFirst for HTML pages for initial state and CSRF token
registerRoute(
({ url }) => !netonly.some((regex) => regex.test(url.pathname)),
({ url }) => url.origin === self.location.origin && !netonly.some((regex) => regex.test(url.pathname)),
new NetworkFirst({
cacheName: 'memories-pages',
}),