From bbd554a4266326f073aa8a3329d1117db838db48 Mon Sep 17 00:00:00 2001 From: zhilv Date: Fri, 27 Mar 2026 20:08:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20CORS,=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=20=E5=BC=80=E5=8F=91=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ckwk/api.go | 4 ++-- internal/router/router.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/ckwk/api.go b/internal/ckwk/api.go index 7769224..1f81e5d 100644 --- a/internal/ckwk/api.go +++ b/internal/ckwk/api.go @@ -39,8 +39,8 @@ func NewWK(username, password, host string, cookies []*http.Cookie) *WK { req := request.NewClient(&request.Config{ UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0", - Proxy: "http://127.0.0.1:9000", - VerifySSL: false, + // Proxy: "http://127.0.0.1:9000", + // VerifySSL: false, }) if len(cookies) > 0 { req.SetCookies(cookies) diff --git a/internal/router/router.go b/internal/router/router.go index 72ede2b..45ea1ea 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -24,9 +24,9 @@ func SetupRouter() *gin.Engine { } r := gin.Default() r.Use(cors.New(cors.Config{ - AllowOrigins: []string{"*.kmux.cn"}, + AllowOrigins: []string{"*.kmux.cn*"}, AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "PATCH"}, - AllowHeaders: []string{"X-Session-Id"}, + AllowHeaders: []string{"*", "X-Session-Id"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true, MaxAge: 12 * time.Hour,