don't mess with splitbee requests
This commit is contained in:
parent
c48bf58784
commit
06f0078dfd
@ -30,11 +30,11 @@ self.addEventListener("message", (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener("fetch", (event) => {
|
self.addEventListener("fetch", (event) => {
|
||||||
|
const url = new URL(event.request.url);
|
||||||
const isSSERequest = event.request.headers.get("Accept") === "text/event-stream";
|
const isSSERequest = event.request.headers.get("Accept") === "text/event-stream";
|
||||||
const isOutsideRequest = !["localhost", "dev.shellphone.app", "www.shellphone.app"].includes(
|
const isOutsideRequest = !["localhost", "dev.shellphone.app", "www.shellphone.app"].includes(url.hostname);
|
||||||
new URL(event.request.url).hostname,
|
const isSplitbeeProxiedRequest = url.pathname.startsWith("/_hive") || url.pathname === "/bee.js";
|
||||||
);
|
if (isSSERequest || isOutsideRequest || isSplitbeeProxiedRequest) {
|
||||||
if (isSSERequest || isOutsideRequest) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user