From 06f0078dfda5654b335ddd72c7f169e22aba1762 Mon Sep 17 00:00:00 2001 From: m5r Date: Mon, 27 Jun 2022 14:44:52 +0200 Subject: [PATCH] don't mess with splitbee requests --- app/entry.worker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/entry.worker.ts b/app/entry.worker.ts index f996fa2..d7db2ed 100644 --- a/app/entry.worker.ts +++ b/app/entry.worker.ts @@ -30,11 +30,11 @@ self.addEventListener("message", (event) => { }); self.addEventListener("fetch", (event) => { + const url = new URL(event.request.url); const isSSERequest = event.request.headers.get("Accept") === "text/event-stream"; - const isOutsideRequest = !["localhost", "dev.shellphone.app", "www.shellphone.app"].includes( - new URL(event.request.url).hostname, - ); - if (isSSERequest || isOutsideRequest) { + const isOutsideRequest = !["localhost", "dev.shellphone.app", "www.shellphone.app"].includes(url.hostname); + const isSplitbeeProxiedRequest = url.pathname.startsWith("/_hive") || url.pathname === "/bee.js"; + if (isSSERequest || isOutsideRequest || isSplitbeeProxiedRequest) { return; }