From 3642757ea471450495a4937f2081f4107ff53208 Mon Sep 17 00:00:00 2001 From: RoOhi <2044812+OriginalRoOhi@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:04:36 +0330 Subject: [PATCH] Fix: Ignore non-http/https protocols in Service Worker handleFetch (#39507) --- app/javascript/mastodon/service_worker/caching.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/mastodon/service_worker/caching.ts b/app/javascript/mastodon/service_worker/caching.ts index 96c2898dd7..304f0284d6 100644 --- a/app/javascript/mastodon/service_worker/caching.ts +++ b/app/javascript/mastodon/service_worker/caching.ts @@ -18,6 +18,10 @@ export async function cacheRoot() { export function handleFetch(event: FetchEvent) { const url = new URL(event.request.url); + if (url.protocol !== 'http:' && url.protocol !== 'https:') { + return; + } + if (url.pathname === '/auth/sign_out') { event.respondWith(handleLogout(event)); } else if (/intl\/.*\.js$/.test(url.pathname)) {