From ee5bc908300a896211f9fb74141b014040853554 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:43:08 +0200 Subject: [PATCH] [release-12.1.2] Chore: Improve short url redirection (#111181) 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 ededeb5846e..d02beb46873 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -462,10 +462,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