mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-08 01:33:43 +08:00
feat: 配置 CORS 以暴露上游响应时间标头
- 在 CORS 配置中添加 `x-one-api-upstream-time` 到 ExposeHeaders
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user