From 302ae89a756b8a3ecb6523746395fd55f8e82cb4 Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Mon, 7 Dec 2020 10:53:18 +0800 Subject: [PATCH] fix pprof. --- server/apiAdmin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/apiAdmin.go b/server/apiAdmin.go index 96e7e26..15f3e00 100644 --- a/server/apiAdmin.go +++ b/server/apiAdmin.go @@ -318,6 +318,10 @@ func AuthMiddleWare() gin.HandlerFunc { if c.Request.Method == "OPTIONS" { c.AbortWithStatus(http.StatusNoContent) } + if strings.Contains(c.Request.URL.Path, "debug") { + c.Next() + return + } // 处理请求 if c.Request.Method != "GET" && c.Request.Method != "POST" { log.Warnf("已拒绝客户端 %v 的请求: 方法错误", c.Request.RemoteAddr)