Skip to content

Commit a539959

Browse files
committed
fix non-GET request
fix non-GET request
1 parent c657dbc commit a539959

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

virtual-downloader.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ async function try_fetch(input, init, tries = 3) {
6565
self.addEventListener("fetch", function (event) {
6666
let request = event.request;
6767
let url = new URL(request.url);
68+
if (request.method !== 'GET') {
69+
return
70+
}
6871
let path = url.pathname;
6972
if (path.startsWith("/s/download")) {
7073
event.respondWith(virtual_downloading_response(path));
@@ -145,6 +148,9 @@ async function virtual_downloading_response(path) {
145148
}
146149

147150
async function cached_response(request) {
151+
if (request.method !== "GET") {
152+
return fetch(request);
153+
}
148154
let resp = await caches.match(request.pathname);
149155
if (resp !== undefined) {
150156
return resp;

0 commit comments

Comments
 (0)