From 3bad52704e9f483bbbc4a9d87e746c08b456bff1 Mon Sep 17 00:00:00 2001 From: Shiwen Cheng Date: Sun, 29 Sep 2024 14:35:28 +0800 Subject: [PATCH] fix(meta): redirect /debug/pprof to avoid jumping to a blank page in meta service --- services/meta/pprof.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/meta/pprof.go b/services/meta/pprof.go index f53944b..a5a0f98 100644 --- a/services/meta/pprof.go +++ b/services/meta/pprof.go @@ -25,6 +25,10 @@ func (h *handler) handleProfiles(w http.ResponseWriter, r *http.Request) { httppprof.Symbol(w, r) case "/debug/pprof/all": h.archiveProfiles(w, r) + case "/debug/pprof": + // Redirect to /debug/pprof/ to avoid jumping to a blank page + // after clicking the links on the /debug/pprof webpage. + http.Redirect(w, r, "/debug/pprof/", http.StatusFound) default: httppprof.Index(w, r) }