]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix 修复pprof工具无法调试
authorqydysky <qydysky@foxmail.com>
Wed, 15 May 2024 16:01:30 +0000 (16:01 +0000)
committerqydysky <qydysky@foxmail.com>
Wed, 15 May 2024 16:01:30 +0000 (16:01 +0000)
Reply/F.go

index d04d2bc5b225875a6f36b3a0e1066dedb369ea44..8e9b9c25ab30a781a4335334c588175662441de0 100644 (file)
@@ -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)