feat(pwa): ✨ update sw fetch handler controlled request
This commit is contained in:
parent
76c6b597a8
commit
b6657b279d
|
|
@ -96,6 +96,15 @@ if (IS_SW) {
|
||||||
// Don't handle 3rd party request
|
// Don't handle 3rd party request
|
||||||
if (url.origin !== location.origin) return
|
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))
|
event.respondWith(fetchHandler(event))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue