Skip to content

Commit

Permalink
fix: UI not redirecting on / (argoproj#2252)
Browse files Browse the repository at this point in the history
Signed-off-by: zachaller <[email protected]>

Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller authored Sep 27, 2022
1 parent 27e4e6e commit a337d4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a337d4f

Please sign in to comment.