From 768f4ccbfe35c7e94697052dfd4f34cd338f13db Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:57:16 +0800 Subject: [PATCH] up --- router/router.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/router/router.go b/router/router.go index d0ba2ba..58e05e7 100644 --- a/router/router.go +++ b/router/router.go @@ -73,6 +73,12 @@ func HandleProxy(c *gin.Context) { var ( localuser bool ) + // 显式处理 OPTIONS 请求 + if c.Request.Method == "OPTIONS" { + c.AbortWithStatus(204) + return + } + auth := c.Request.Header.Get("Authorization") if len(auth) > 7 && auth[:7] == "Bearer " { localuser = store.IsExistAuthCache(auth[7:])