mirror of
https://github.com/dani-garcia/bw_web_builds.git
synced 2024-12-26 04:18:15 +03:00
Strip query params when resolving subpath
This commit is contained in:
parent
47e1f1c668
commit
ee6792405b
1 changed files with 3 additions and 3 deletions
|
@ -554,11 +554,11 @@ index c2eb37eea5..2b5ac93392 100644
|
||||||
+ //
|
+ //
|
||||||
+ // - `https://vaultwarden.example.com/base/path/`
|
+ // - `https://vaultwarden.example.com/base/path/`
|
||||||
+ // - `https://vaultwarden.example.com/base/path/#/some/route[?queryParam=...]`
|
+ // - `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`.
|
+ // We want to get to just `https://vaultwarden.example.com/base/path`.
|
||||||
+ let baseUrl = this.win.location.href;
|
+ let baseUrl = this.win.location.href;
|
||||||
+ baseUrl = baseUrl.replace(/#.*/, ""); // Strip off `#` and everything after.
|
+ baseUrl = baseUrl.replace(/(\/+|\/*#.*|\/*\?.*)$/, ""); // Strip off trailing `/`, `#`, `?` and everything after.
|
||||||
+ baseUrl = baseUrl.replace(/\/+$/, ""); // Trim any trailing `/` chars.
|
|
||||||
+ const urls = { base: baseUrl };
|
+ const urls = { base: baseUrl };
|
||||||
|
|
||||||
// Find the region
|
// Find the region
|
||||||
|
|
Loading…
Reference in a new issue