From 58ec21d676c3d42a17a3d86c5f2ddc2e72350698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 22 Jul 2023 15:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96HTTP=E6=8A=A5=E5=A4=B4?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/shared/http_header_policy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/serverconfigs/shared/http_header_policy.go b/pkg/serverconfigs/shared/http_header_policy.go index a3fa296..af404b6 100644 --- a/pkg/serverconfigs/shared/http_header_policy.go +++ b/pkg/serverconfigs/shared/http_header_policy.go @@ -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