Skip to content

Commit

Permalink
Strip query params when resolving subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
Timshel committed Jul 5, 2024
1 parent 47e1f1c commit 5b67330
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions patches/v2024.5.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ diff --git a/apps/web/src/app/platform/web-environment.service.ts b/apps/web/src
index c2eb37eea5..2b5ac93392 100644
--- a/apps/web/src/app/platform/web-environment.service.ts
+++ b/apps/web/src/app/platform/web-environment.service.ts
@@ -27,8 +27,17 @@ export class WebEnvironmentService extends DefaultEnvironmentService {
@@ -27,8 +27,16 @@ export class WebEnvironmentService extends DefaultEnvironmentService {
super(stateProvider, accountService);

// The web vault always uses the current location as the base url
Expand All @@ -557,8 +557,7 @@ index c2eb37eea5..2b5ac93392 100644
+ //
+ // We want to get to just `https://vaultwarden.example.com/base/path`.
+ let baseUrl = this.win.location.href;
+ baseUrl = baseUrl.replace(/#.*/, ""); // Strip off `#` and everything after.
+ baseUrl = baseUrl.replace(/\/+$/, ""); // Trim any trailing `/` chars.
+ baseUrl = baseUrl.replace(/(\/+|\/*#.*|\/*\?.*)$/, ""); // Strip off trailing `/`, `#`, `?` and everything after.
+ const urls = { base: baseUrl };

// Find the region
Expand Down

0 comments on commit 5b67330

Please sign in to comment.