redirect handler for pprof index (#3503)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
parent
25ef9b2d69
commit
799dce4bff
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue