[add] progress streaming
Some checks failed
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2023-12-01 07:35:51 -05:00
parent 2c240f2f5c
commit 313fb5b30c
10 changed files with 256 additions and 18 deletions

View File

@@ -253,6 +253,13 @@ self.addEventListener("install", function (event) {
event.waitUntil(handleInstall(event));
});
self.addEventListener("fetch", (event) =>
event.respondWith(handleFetch(event))
);
self.addEventListener("fetch", (event) => {
/**
* Weird things happen when a service worker attempts to handle a request
* when the server responds with chunked transfer encoding. Right now we only
* use chunked encoding on POSTs. So this is to avoid processing those.
**/
if (event.request.method != "GET") return;
return event.respondWith(handleFetch(event));
});