From: qydysky Date: Wed, 15 May 2024 16:01:30 +0000 (+0000) Subject: Fix 修复pprof工具无法调试 X-Git-Tag: v0.14.0~5 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=9684a7ce2c3b3dee3ba3be2a3652639af87b2f12;p=bili_danmu%2F.git Fix 修复pprof工具无法调试 --- diff --git a/Reply/F.go b/Reply/F.go index d04d2bc..8e9b9c2 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -1142,31 +1142,31 @@ func init() { // debug模式 if de, ok := c.C.K_v.LoadV(`debug模式`).(bool); ok && de { c.C.SerF.Store("/debug/pprof/", func(w http.ResponseWriter, r *http.Request) { - if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) { + if c.DefaultHttpCheck(c.C, w, r, http.MethodGet, http.MethodPost) { return } pprof.Index(w, r) }) c.C.SerF.Store("/debug/pprof/cmdline", func(w http.ResponseWriter, r *http.Request) { - if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) { + if c.DefaultHttpCheck(c.C, w, r, http.MethodGet, http.MethodPost) { return } pprof.Cmdline(w, r) }) c.C.SerF.Store("/debug/pprof/profile", func(w http.ResponseWriter, r *http.Request) { - if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) { + if c.DefaultHttpCheck(c.C, w, r, http.MethodGet, http.MethodPost) { return } pprof.Profile(w, r) }) c.C.SerF.Store("/debug/pprof/symbol", func(w http.ResponseWriter, r *http.Request) { - if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) { + if c.DefaultHttpCheck(c.C, w, r, http.MethodGet, http.MethodPost) { return } pprof.Symbol(w, r) }) c.C.SerF.Store("/debug/pprof/trace", func(w http.ResponseWriter, r *http.Request) { - if c.DefaultHttpCheck(c.C, w, r, http.MethodGet) { + if c.DefaultHttpCheck(c.C, w, r, http.MethodGet, http.MethodPost) { return } pprof.Trace(w, r)