redirect handler for pprof index (#3503)

Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
Zou Nengren 2019-12-07 03:04:49 +08:00 committed by Miek Gieben
parent 25ef9b2d69
commit 799dce4bff

View file

@ -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)