From 63a24d5e761b5b666b4b5477eb575bf2f4b4f852 Mon Sep 17 00:00:00 2001 From: Timshel Date: Thu, 8 Aug 2024 13:24:20 +0200 Subject: [PATCH] Strip query params when resolving subpath --- patches/v2024.6.2.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/v2024.6.2.patch b/patches/v2024.6.2.patch index 873840e..7c3fbe6 100644 --- a/patches/v2024.6.2.patch +++ b/patches/v2024.6.2.patch @@ -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