summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/gzip_redirect_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/serviceworkers/test/gzip_redirect_worker.js')
-rw-r--r--dom/serviceworkers/test/gzip_redirect_worker.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/dom/serviceworkers/test/gzip_redirect_worker.js b/dom/serviceworkers/test/gzip_redirect_worker.js
new file mode 100644
index 0000000000..dcee4b3b18
--- /dev/null
+++ b/dom/serviceworkers/test/gzip_redirect_worker.js
@@ -0,0 +1,15 @@
+self.addEventListener("fetch", function (event) {
+ if (!event.request.url.endsWith("sw_clients/does_not_exist.html")) {
+ return;
+ }
+
+ event.respondWith(
+ new Response("", {
+ status: 301,
+ statusText: "Moved Permanently",
+ headers: {
+ Location: "refresher_compressed.html",
+ },
+ })
+ );
+});