From 30123160ce6a6f00cfd041c59586ecfcdde4923c Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 8 May 2024 17:52:20 +0800 Subject: [PATCH] =?UTF-8?q?WAF=E5=8C=BA=E5=9F=9F=E5=B0=81=E7=A6=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=85=81=E8=AE=B8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E2=80=9D=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_waf.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/nodes/http_request_waf.go b/internal/nodes/http_request_waf.go index 6c0e640..4c22478 100644 --- a/internal/nodes/http_request_waf.go +++ b/internal/nodes/http_request_waf.go @@ -8,6 +8,7 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/stats" "github.com/TeaOSLab/EdgeNode/internal/waf" + wafutils "github.com/TeaOSLab/EdgeNode/internal/waf/utils" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/types" "io" @@ -225,7 +226,7 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir var currentURL = this.URL() if regionConfig.MatchCountryURL(currentURL) { // 检查国家/地区级别封禁 - if !regionConfig.IsAllowedCountry(result.CountryId(), result.ProvinceId()) { + if !regionConfig.IsAllowedCountry(result.CountryId(), result.ProvinceId()) && (!regionConfig.AllowSearchEngine || wafutils.CheckSearchEngine(remoteAddr)) { this.firewallPolicyId = firewallPolicy.Id if isDefendMode {