From 799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3 Mon Sep 17 00:00:00 2001 From: Zou Nengren Date: Sat, 7 Dec 2019 03:04:49 +0800 Subject: [PATCH] redirect handler for pprof index (#3503) Signed-off-by: zouyee --- plugin/pprof/pprof.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/pprof/pprof.go b/plugin/pprof/pprof.go index ddf5ab2df..822e6e222 100644 --- a/plugin/pprof/pprof.go +++ b/plugin/pprof/pprof.go @@ -31,6 +31,9 @@ func (h *handler) Startup() error { h.ln = ln h.mux = http.NewServeMux() + h.mux.HandleFunc(path, func(rw http.ResponseWriter, req *http.Request) { + http.Redirect(rw, req, path+"/", http.StatusFound) + }) h.mux.HandleFunc(path+"/", pp.Index) h.mux.HandleFunc(path+"/cmdline", pp.Cmdline) h.mux.HandleFunc(path+"/profile", pp.Profile)