Skip to content

Commit ee67924

Browse files
committed
Strip query params when resolving subpath
1 parent 47e1f1c commit ee67924

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

patches/v2024.5.0.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,13 @@ index c2eb37eea5..2b5ac93392 100644
554554
+ //
555555
+ // - `https://vaultwarden.example.com/base/path/`
556556
+ // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
557+
+ // - `https://vaultwarden.example.com/base/path/?queryParam=...`
557558
+ //
558559
+ // We want to get to just `https://vaultwarden.example.com/base/path`.
559560
+ let baseUrl = this.win.location.href;
560-
+ baseUrl = baseUrl.replace(/#.*/, ""); // Strip off `#` and everything after.
561-
+ baseUrl = baseUrl.replace(/\/+$/, ""); // Trim any trailing `/` chars.
561+
+ baseUrl = baseUrl.replace(/(\/+|\/*#.*|\/*\?.*)$/, ""); // Strip off trailing `/`, `#`, `?` and everything after.
562562
+ const urls = { base: baseUrl };
563-
563+
564564
// Find the region
565565
const domain = Utils.getDomain(this.win.location.href);
566566
diff --git a/apps/web/src/app/shared/loose-components.module.ts b/apps/web/src/app/shared/loose-components.module.ts

0 commit comments

Comments
 (0)