Skip to content

Commit 713fae9

Browse files
committed
frontend: fix stripping too much from url
This fixes an issue that caused static pages, e.g. the firmware upload via recovery page to stop working
1 parent 7b0de09 commit 713fae9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/sw.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function handleWGRequest(event: FetchEvent) {
3939
firmware_version = parsedUrl.searchParams.get("firmware_version");
4040
firmware_version = firmware_version?.replace("+", "_") || null;
4141
firmware_version = firmware_version?.replaceAll(".", "_") || null;
42-
url = url.slice(0, url.indexOf("?"));
42+
if (url.indexOf("?") !== -1) {
43+
url = url.slice(0, url.indexOf("?"));
44+
}
4345
} else {
4446
receiver_id = event.request.headers.get("X-Connection-Id") as string;
4547
}

0 commit comments

Comments
 (0)