UI: fix redirect when web.routePrefix configured

Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
This commit is contained in:
Mara Sophie Grosch 2025-09-29 15:55:04 +03:00
parent c9e0e36701
commit 93887a9b82
1 changed files with 2 additions and 2 deletions

View File

@ -417,12 +417,12 @@ func New(logger *slog.Logger, o *Options) *Handler {
readyf := h.testReady readyf := h.testReady
router.Get("/", func(w http.ResponseWriter, r *http.Request) { 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 { if !o.UseOldUI {
router.Get("/graph", func(w http.ResponseWriter, r *http.Request) { 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)
}) })
} }