diff options
author | 2019-12-07 03:04:49 +0800 | |
---|---|---|
committer | 2019-12-06 19:04:49 +0000 | |
commit | 799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3 (patch) | |
tree | 63e0216b268c7dc3d9b918dec82a0a21f3a99f71 /plugin | |
parent | 25ef9b2d697fba0499f98314de3d98184eb5394b (diff) | |
download | coredns-799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3.tar.gz coredns-799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3.tar.zst coredns-799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3.zip |
redirect handler for pprof index (#3503)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/pprof/pprof.go | 3 |
1 files changed, 3 insertions, 0 deletions
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) |