From e30e6cc7a15c4b2e9010554b3882edb81e829cf1 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 15:42:02 +0200 Subject: [PATCH] [release-11.6.6] Chore: Improve short url redirection (#111179) Chore: Improve short url redirection (#111162) Improve short url redirection (cherry picked from commit 81fe57478fa5bc0977d7c00b62848485fc3ae35c) Co-authored-by: Misi --- public/app/app.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/app/app.ts b/public/app/app.ts index d8fb6580bd9..1acb3ece9a5 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -438,10 +438,8 @@ function handleRedirectTo(): void { let decodedRedirectTo = decodeURIComponent(redirectTo); if (decodedRedirectTo.startsWith('/goto/')) { // In this case there should be a request to the backend - if (config.appSubUrl && !decodedRedirectTo.startsWith(config.appSubUrl)) { - decodedRedirectTo = config.appSubUrl + decodedRedirectTo; - } - window.location.replace(decodedRedirectTo); + const urlToRedirectTo = locationUtil.assureBaseUrl(decodedRedirectTo); + window.location.replace(urlToRedirectTo); return; } // Ensure that the appsuburl is stripped from the redirect to in case of a frontend redirect