From 81f94504013c1b0c34bc0a3aeffd21fa17ebb7e4 Mon Sep 17 00:00:00 2001 From: Morlay Date: Fri, 24 Nov 2023 16:57:01 +0800 Subject: [PATCH] fix: pprof Index path fix --- pkg/http/middleware/pprof_handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/http/middleware/pprof_handler.go b/pkg/http/middleware/pprof_handler.go index 6d5c997..3f508c4 100644 --- a/pkg/http/middleware/pprof_handler.go +++ b/pkg/http/middleware/pprof_handler.go @@ -36,6 +36,8 @@ func (h *pprofHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { pprof.Trace(rw, req) return default: + // trim /.sys for make pprof.Index work + req.URL.Path = req.URL.Path[len("/.sys"):] pprof.Index(rw, req) return }