mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 03:00:26 +08:00
HTTP Header - CORS跨域设置增加多个选项
This commit is contained in:
@@ -222,7 +222,7 @@ func (this *HTTPHeaderPolicyDAO) ComposeHeaderPolicyConfig(tx *dbs.Tx, headerPol
|
|||||||
|
|
||||||
// CORS
|
// CORS
|
||||||
if IsNotNull(policy.Cors) {
|
if IsNotNull(policy.Cors) {
|
||||||
var corsConfig = &shared.HTTPCORSHeaderConfig{}
|
var corsConfig = shared.NewHTTPCORSHeaderConfig()
|
||||||
err = json.Unmarshal(policy.Cors, corsConfig)
|
err = json.Unmarshal(policy.Cors, corsConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ func (this *HTTPHeaderPolicyService) UpdateHTTPHeaderPolicyCORS(ctx context.Cont
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var corsConfig = &shared.HTTPCORSHeaderConfig{}
|
var corsConfig = shared.NewHTTPCORSHeaderConfig()
|
||||||
err = json.Unmarshal(req.CorsJSON, corsConfig)
|
err = json.Unmarshal(req.CorsJSON, corsConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user