From b010efcce2badc4b8b8c5f76f20c7124d08d307e Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sat, 4 Dec 2021 19:28:02 +0800 Subject: [PATCH] =?UTF-8?q?WAF=E5=BF=BD=E7=95=A5=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=96=AD=E5=BC=80=E8=BF=9E=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_waf.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/nodes/http_request_waf.go b/internal/nodes/http_request_waf.go index f93d02d..cec3371 100644 --- a/internal/nodes/http_request_waf.go +++ b/internal/nodes/http_request_waf.go @@ -184,7 +184,9 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir goNext, ruleGroup, ruleSet, err := w.MatchRequest(this, this.writer) if err != nil { - remotelogs.Error("HTTP_REQUEST_WAF", this.rawURI+": "+err.Error()) + if !this.canIgnore(err) { + remotelogs.Error("HTTP_REQUEST_WAF", this.rawURI+": "+err.Error()) + } return } @@ -240,7 +242,9 @@ func (this *HTTPRequest) checkWAFResponse(firewallPolicy *firewallconfigs.HTTPFi goNext, ruleGroup, ruleSet, err := w.MatchResponse(this, resp, this.writer) if err != nil { - remotelogs.Error("HTTP_REQUEST_WAF", this.rawURI+": "+err.Error()) + if !this.canIgnore(err) { + remotelogs.Error("HTTP_REQUEST_WAF", this.rawURI+": "+err.Error()) + } return } @@ -289,6 +293,7 @@ func (this *HTTPRequest) WAFReadBody(max int64) (data []byte, err error) { if this.RawReq.ContentLength > 0 { data, err = ioutil.ReadAll(io.LimitReader(this.RawReq.Body, max)) } + return }