From dbe2b54099556980454356a98cf5eb0b0f121e66 Mon Sep 17 00:00:00 2001 From: Shine Date: Wed, 12 Mar 2025 18:58:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=20CORS=20=E4=BB=A5?= =?UTF-8?q?=E6=9A=B4=E9=9C=B2=E4=B8=8A=E6=B8=B8=E5=93=8D=E5=BA=94=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=A0=87=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 CORS 配置中添加 `x-one-api-upstream-time` 到 ExposeHeaders --- middleware/cors.go | 1 + 1 file changed, 1 insertion(+) diff --git a/middleware/cors.go b/middleware/cors.go index d2a109ab..f98aad24 100644 --- a/middleware/cors.go +++ b/middleware/cors.go @@ -11,5 +11,6 @@ func CORS() gin.HandlerFunc { config.AllowCredentials = true config.AllowMethods = []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"} config.AllowHeaders = []string{"*"} + config.ExposeHeaders = []string{"x-one-api-upstream-time"} return cors.New(config) }