From 39b8f28fc4986f3ebf47b998aac68878c978b8e8 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Sun, 15 May 2022 16:17:52 +0800 Subject: [PATCH] fix: disable pprof while not debug --- server/static.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/static.go b/server/static.go index c60b98d4..8ef8fd07 100644 --- a/server/static.go +++ b/server/static.go @@ -50,7 +50,7 @@ func Static(r *gin.Engine) { c.Status(200) if strings.HasPrefix(c.Request.URL.Path, "/@manage") { _, _ = c.Writer.WriteString(conf.ManageHtml) - } else if strings.HasPrefix(c.Request.URL.Path, "/debug/pprof") { + } else if strings.HasPrefix(c.Request.URL.Path, "/debug/pprof") && conf.Debug { pprof.Index(c.Writer, c.Request) } else { _, _ = c.Writer.WriteString(conf.IndexHtml)