From 293fc94fdbde94e3c77e6e592cfd53cf40158386 Mon Sep 17 00:00:00 2001 From: zachaller Date: Mon, 19 Sep 2022 22:36:37 -0700 Subject: [PATCH] fix: UI not redirecting on / Signed-off-by: zachaller --- server/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/server.go b/server/server.go index f90b372d1c..62c8714b9f 100644 --- a/server/server.go +++ b/server/server.go @@ -124,6 +124,12 @@ func (s *ArgoRolloutsServer) newHTTPServer(ctx context.Context, port int) *http. mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { requestedURI := path.Clean(r.RequestURI) rootPath := path.Clean("/" + s.Options.RootPath) + + if requestedURI == "/" { + http.Redirect(w, r, rootPath+"/", http.StatusFound) + return + } + //If the rootPath is not in the prefix 404 if !strings.HasPrefix(requestedURI, rootPath) { http.NotFound(w, r)