forked from mystiq/hydrogen-web
More checks before returning
This commit is contained in:
parent
d31371b486
commit
d1491cc203
1 changed files with 4 additions and 2 deletions
|
@ -68,8 +68,10 @@ async function purgeOldCaches() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.addEventListener('fetch', (event) => {
|
self.addEventListener('fetch', async (event) => {
|
||||||
if (event.request.url.indexOf("upload") !== -1) {
|
if (event.request.method === "POST" &&
|
||||||
|
(await event.request.blob()).type !== "application/json" &&
|
||||||
|
event.request.body) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.respondWith(handleRequest(event.request));
|
event.respondWith(handleRequest(event.request));
|
||||||
|
|
Loading…
Reference in a new issue