mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
Merge pull request #5517 from hashicorp/ui-handle-redirect
redirect ui to ui/
This commit is contained in:
commit
ac13e4e554
@ -126,7 +126,8 @@ func Handler(props *vault.HandlerProperties) http.Handler {
|
|||||||
} else {
|
} else {
|
||||||
mux.Handle("/ui/", handleUIHeaders(core, handleUIStub()))
|
mux.Handle("/ui/", handleUIHeaders(core, handleUIStub()))
|
||||||
}
|
}
|
||||||
mux.Handle("/", handleRootRedirect())
|
mux.Handle("/ui", handleUIRedirect())
|
||||||
|
mux.Handle("/", handleUIRedirect())
|
||||||
}
|
}
|
||||||
|
|
||||||
additionalRoutes(mux, core)
|
additionalRoutes(mux, core)
|
||||||
@ -181,7 +182,7 @@ func wrapGenericHandler(core *vault.Core, h http.Handler, maxRequestSize int64,
|
|||||||
}
|
}
|
||||||
r = newR
|
r = newR
|
||||||
|
|
||||||
case strings.HasPrefix(r.URL.Path, "/ui/"), r.URL.Path == "/":
|
case strings.HasPrefix(r.URL.Path, "/ui"), r.URL.Path == "/":
|
||||||
default:
|
default:
|
||||||
respondError(w, http.StatusNotFound, nil)
|
respondError(w, http.StatusNotFound, nil)
|
||||||
cancelFunc()
|
cancelFunc()
|
||||||
@ -364,7 +365,7 @@ func handleUIStub() http.Handler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleRootRedirect() http.Handler {
|
func handleUIRedirect() http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||||
http.Redirect(w, req, "/ui/", 307)
|
http.Redirect(w, req, "/ui/", 307)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user