Skip to content

Commit

Permalink
Merge pull request #176 from Timshel/feature/subpath
Browse files Browse the repository at this point in the history
Strip query params when resolving subpath
  • Loading branch information
BlackDex authored Aug 8, 2024
2 parents c7b1985 + 63a24d5 commit a044d67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/v2024.6.2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,11 @@ index c2eb37eea5..2b5ac93392 100644
+ //
+ // - `https://vaultwarden.example.com/base/path/`
+ // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
+ // - `https://vaultwarden.example.com/base/path/?queryParam=...`
+ //
+ // 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 a044d67

Please sign in to comment.