feat: auto start workers
This commit is contained in:
17
backend/modules/middlewares/m_check_ua.go
Normal file
17
backend/modules/middlewares/m_check_ua.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func (m *Middlewares) CheckUA(ctx fiber.Ctx) error {
|
||||
keyword := strings.ToLower("MicroMessenger")
|
||||
userAgent := ctx.GetReqHeaders()["User-Agent"][0]
|
||||
|
||||
if strings.Contains(userAgent, keyword) {
|
||||
return ctx.SendString("")
|
||||
}
|
||||
return ctx.Next()
|
||||
}
|
||||
Reference in New Issue
Block a user