From 8e629a2a11bd4a8627733de79a8f7b8dc3228fce Mon Sep 17 00:00:00 2001 From: hackerxiao <2945294768@qq.com> Date: Fri, 12 Dec 2025 17:27:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=BB=85=E4=BD=BF?= =?UTF-8?q?=E7=94=A8x-api-key=E8=8E=B7=E5=8F=96anthropic=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E5=9E=8B=E5=88=97=E8=A1=A8=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/auth.go b/middleware/auth.go index 40afabfc..68e73d18 100644 --- a/middleware/auth.go +++ b/middleware/auth.go @@ -193,7 +193,7 @@ func TokenAuth() func(c *gin.Context) { } c.Request.Header.Set("Authorization", "Bearer "+key) } - // 检查path包含/v1/messages + // 检查path包含/v1/messages 或 /v1/models if strings.Contains(c.Request.URL.Path, "/v1/messages") || strings.Contains(c.Request.URL.Path, "/v1/models") { anthropicKey := c.Request.Header.Get("x-api-key") if anthropicKey != "" {