fix: wechat verify
This commit is contained in:
@@ -7,10 +7,14 @@ import (
|
||||
)
|
||||
|
||||
func (m *Middlewares) CheckUA(ctx fiber.Ctx) error {
|
||||
if m.app.IsDevMode() {
|
||||
return ctx.Next()
|
||||
}
|
||||
|
||||
keyword := strings.ToLower("MicroMessenger")
|
||||
userAgent := ctx.GetReqHeaders()["User-Agent"][0]
|
||||
|
||||
if strings.Contains(userAgent, keyword) {
|
||||
if !strings.Contains(userAgent, keyword) {
|
||||
return ctx.SendString("")
|
||||
}
|
||||
return ctx.Next()
|
||||
|
||||
Reference in New Issue
Block a user