优化HTTP报头策略是否为空的判断

This commit is contained in:
GoEdgeLab
2023-07-22 15:00:15 +08:00
parent f9e41eeac2
commit 709e27aac0

View File

@@ -51,7 +51,11 @@ func (this *HTTPHeaderPolicy) Init() error {
// IsEmpty 判断是否为空
func (this *HTTPHeaderPolicy) IsEmpty() bool {
return len(this.SetHeaders) == 0 && this.Expires == nil && len(this.DeleteHeaders) == 0
return len(this.SetHeaders) == 0 &&
this.Expires == nil &&
len(this.DeleteHeaders) == 0 &&
len(this.NonStandardHeaders) == 0 &&
(this.CORS == nil || !this.CORS.IsOn)
}
// ContainsHeader 判断Add和Set中是否包含某个Header