sw: restore origin check
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/953/head
parent
81c8fc3049
commit
764505b039
|
@ -38,7 +38,7 @@ const cachefirst = [
|
||||||
|
|
||||||
// Cache static file assets
|
// Cache static file assets
|
||||||
registerRoute(
|
registerRoute(
|
||||||
({ url }) => cachefirst.some((regex) => regex.test(url.pathname)),
|
({ url }) => url.origin === self.location.origin && cachefirst.some((regex) => regex.test(url.pathname)),
|
||||||
new CacheFirst({
|
new CacheFirst({
|
||||||
cacheName: 'memories-pages',
|
cacheName: 'memories-pages',
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -61,7 +61,7 @@ const netonly = [
|
||||||
|
|
||||||
// Use NetworkFirst for HTML pages for initial state and CSRF token
|
// Use NetworkFirst for HTML pages for initial state and CSRF token
|
||||||
registerRoute(
|
registerRoute(
|
||||||
({ url }) => !netonly.some((regex) => regex.test(url.pathname)),
|
({ url }) => url.origin === self.location.origin && !netonly.some((regex) => regex.test(url.pathname)),
|
||||||
new NetworkFirst({
|
new NetworkFirst({
|
||||||
cacheName: 'memories-pages',
|
cacheName: 'memories-pages',
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue