aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Zou Nengren <zounengren@cmss.chinamobile.com> 2019-12-07 03:04:49 +0800
committerGravatar Miek Gieben <miek@miek.nl> 2019-12-06 19:04:49 +0000
commit799dce4bffeb6d40b5b15cca47f34d4a7d24e6d3 (patch)
tree63e0216b268c7dc3d9b918dec82a0a21f3a99f71 /plugin
parent25ef9b2d697fba0499f98314de3d98184eb5394b (diff)
downloadcoredns-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.go3
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)