mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 15:51:54 +08:00 
			
		
		
		
	WAF区域封禁增加“允许搜索引擎”选项
This commit is contained in:
		@@ -8,6 +8,7 @@ import (
 | 
				
			|||||||
	"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
 | 
						"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
 | 
				
			||||||
	"github.com/TeaOSLab/EdgeNode/internal/stats"
 | 
						"github.com/TeaOSLab/EdgeNode/internal/stats"
 | 
				
			||||||
	"github.com/TeaOSLab/EdgeNode/internal/waf"
 | 
						"github.com/TeaOSLab/EdgeNode/internal/waf"
 | 
				
			||||||
 | 
						wafutils "github.com/TeaOSLab/EdgeNode/internal/waf/utils"
 | 
				
			||||||
	"github.com/iwind/TeaGo/Tea"
 | 
						"github.com/iwind/TeaGo/Tea"
 | 
				
			||||||
	"github.com/iwind/TeaGo/types"
 | 
						"github.com/iwind/TeaGo/types"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
@@ -225,7 +226,7 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
 | 
				
			|||||||
					var currentURL = this.URL()
 | 
										var currentURL = this.URL()
 | 
				
			||||||
					if regionConfig.MatchCountryURL(currentURL) {
 | 
										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
 | 
												this.firewallPolicyId = firewallPolicy.Id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							if isDefendMode {
 | 
												if isDefendMode {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user