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