feat(pwa): update sw fetch handler controlled request

This commit is contained in:
Julien Oculi 2024-07-19 14:57:01 +02:00
parent 76c6b597a8
commit b6657b279d

View file

@ -96,6 +96,15 @@ if (IS_SW) {
// Don't handle 3rd party request
if (url.origin !== location.origin) return
// Don't handle network probe
if (url.pathname === '/api/serviceworker/is-online') return
// Don't handle non-GET
if (event.request.method !== 'GET') return
// Don't handle non-https
if (url.protocol !== 'https:') return
event.respondWith(fetchHandler(event))
})