fixup redirect
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
3e30960694
commit
de55453a6c
@ -15,7 +15,7 @@ func NewHandler(prefixPath string, initFuncs ...func()) http.HandlerFunc {
|
||||
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
switch {
|
||||
case strings.EqualFold(r.RequestURI, prefixPath) && r.RequestURI[len(r.RequestURI)] != '/':
|
||||
case strings.EqualFold(r.RequestURI, prefixPath) && r.RequestURI[len(r.RequestURI)-1] != '/':
|
||||
http.Redirect(w, r, r.RequestURI+"/", http.StatusMovedPermanently)
|
||||
case strings.HasPrefix(r.RequestURI, path.Join(prefixPath, "cmdline")):
|
||||
pprof.Cmdline(w, r)
|
||||
|
Loading…
Reference in New Issue
Block a user