respond with only for GET requests

This commit is contained in:
RMidhunSuresh 2021-11-08 18:03:20 +05:30
parent d1491cc203
commit c1a8ffd814

View file

@ -69,12 +69,9 @@ async function purgeOldCaches() {
}
self.addEventListener('fetch', async (event) => {
if (event.request.method === "POST" &&
(await event.request.blob()).type !== "application/json" &&
event.request.body) {
return;
if (event.request.method === "GET") {
event.respondWith(handleRequest(event.request));
}
event.respondWith(handleRequest(event.request));
});
function isCacheableThumbnail(url) {