From 515a590681abe4f295c51ce18509f372be8cc53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 21 Jul 2022 13:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E5=B0=81=E7=A6=81=E4=B9=9F?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_waf.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/nodes/http_request_waf.go b/internal/nodes/http_request_waf.go index 02284a8..db04083 100644 --- a/internal/nodes/http_request_waf.go +++ b/internal/nodes/http_request_waf.go @@ -177,7 +177,8 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir if countryId > 0 && lists.ContainsInt64(regionConfig.DenyCountryIds, countryId) { this.firewallPolicyId = firewallPolicy.Id - this.writer.WriteHeader(http.StatusForbidden) + this.writeCode(http.StatusForbidden) + this.writer.Flush() this.writer.Close() // 停止日志 @@ -197,7 +198,8 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir if provinceId > 0 && lists.ContainsInt64(regionConfig.DenyProvinceIds, provinceId) { this.firewallPolicyId = firewallPolicy.Id - this.writer.WriteHeader(http.StatusForbidden) + this.writeCode(http.StatusForbidden) + this.writer.Flush() this.writer.Close() // 停止日志