Skip to content

Commit 1c47b5f

Browse files
committed
frontend/sw: use the parsed url to strip firmware version
fix #212
1 parent 8dcf4ac commit 1c47b5f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/sw.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +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-
if (url.indexOf("?") !== -1) {
43-
url = url.slice(0, url.indexOf("?"));
42+
if (parsedUrl.pathname !== "/") {
43+
firmware_version = null;
44+
url = parsedUrl.pathname;
4445
}
4546
} else {
4647
receiver_id = event.request.headers.get("X-Connection-Id") as string;

0 commit comments

Comments
 (0)