From ee6792405bb2f72cda21994108932dd4320f0fd2 Mon Sep 17 00:00:00 2001 From: Timshel Date: Fri, 5 Jul 2024 18:20:12 +0200 Subject: [PATCH] Strip query params when resolving subpath --- patches/v2024.5.0.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/v2024.5.0.patch b/patches/v2024.5.0.patch index d963f6a..56b9c15 100644 --- a/patches/v2024.5.0.patch +++ b/patches/v2024.5.0.patch @@ -554,13 +554,13 @@ 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 const domain = Utils.getDomain(this.win.location.href); diff --git a/apps/web/src/app/shared/loose-components.module.ts b/apps/web/src/app/shared/loose-components.module.ts