mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +01:00
More checks before returning
This commit is contained in:
parent
d31371b486
commit
d1491cc203
@ -68,8 +68,10 @@ async function purgeOldCaches() {
|
||||
}
|
||||
}
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
if (event.request.url.indexOf("upload") !== -1) {
|
||||
self.addEventListener('fetch', async (event) => {
|
||||
if (event.request.method === "POST" &&
|
||||
(await event.request.blob()).type !== "application/json" &&
|
||||
event.request.body) {
|
||||
return;
|
||||
}
|
||||
event.respondWith(handleRequest(event.request));
|
||||
|
Loading…
x
Reference in New Issue
Block a user