From e10fd15eebf7bcb1ee78496e94f538bf4c90859c 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:50:19 +0200 Subject: [PATCH] [release-11.5.9] Chore: Improve short url redirection (#111178) 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 dc65fe884a3..97c26df61a6 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -428,10 +428,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