feat: update

This commit is contained in:
yanghao05
2025-04-29 20:22:14 +08:00
parent 5dc8431f19
commit 128dc4cdab
2 changed files with 12 additions and 0 deletions

View File

@@ -29,6 +29,11 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
return ctx.Next()
}
// check is XMLHttpRequest
if ctx.XHR() {
return ctx.SendStatus(fiber.StatusUnauthorized)
}
fullUrl := utils.FullURI(ctx)
u, err := url.Parse(fullUrl)
if err != nil {