1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

fix pprof.

This commit is contained in:
Mrs4s 2020-12-07 10:53:18 +08:00
parent d8b9eb611f
commit 302ae89a75

View File

@ -318,6 +318,10 @@ func AuthMiddleWare() gin.HandlerFunc {
if c.Request.Method == "OPTIONS" { if c.Request.Method == "OPTIONS" {
c.AbortWithStatus(http.StatusNoContent) c.AbortWithStatus(http.StatusNoContent)
} }
if strings.Contains(c.Request.URL.Path, "debug") {
c.Next()
return
}
// 处理请求 // 处理请求
if c.Request.Method != "GET" && c.Request.Method != "POST" { if c.Request.Method != "GET" && c.Request.Method != "POST" {
log.Warnf("已拒绝客户端 %v 的请求: 方法错误", c.Request.RemoteAddr) log.Warnf("已拒绝客户端 %v 的请求: 方法错误", c.Request.RemoteAddr)