From c0e87eeb983802077c8a94a3cb049ac99089c54f 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:44:11 +0200 Subject: [PATCH] [release-12.0.5] Chore: Improve short url redirection (#111180) 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 3c2c9b2eb73..d9f12d22400 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -439,10 +439,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