Merge pull request #17240 from LittleFox94/fix-web-redirect

UI: fix redirect when web.routePrefix configured
This commit is contained in:
Julius Volz 2025-09-30 18:15:39 +02:00 committed by GitHub
commit cc7b1de372
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -417,12 +417,12 @@ func New(logger *slog.Logger, o *Options) *Handler {
readyf := h.testReady
router.Get("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, path.Join(o.ExternalURL.Path, homePage), http.StatusFound)
http.Redirect(w, r, path.Join(o.RoutePrefix, homePage), http.StatusFound)
})
if !o.UseOldUI {
router.Get("/graph", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, path.Join(o.ExternalURL.Path, "/query?"+r.URL.RawQuery), http.StatusFound)
http.Redirect(w, r, path.Join(o.RoutePrefix, "/query?"+r.URL.RawQuery), http.StatusFound)
})
}