mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	修复IP黑名单为服务时不生效的问题
This commit is contained in:
		@@ -22,10 +22,25 @@ func (this *HTTPRequest) doWAFRequest() (blocked bool) {
 | 
				
			|||||||
	if conn != nil {
 | 
						if conn != nil {
 | 
				
			||||||
		trafficConn, ok := conn.(*TrafficConn)
 | 
							trafficConn, ok := conn.(*TrafficConn)
 | 
				
			||||||
		if ok && trafficConn.IsClosed() {
 | 
							if ok && trafficConn.IsClosed() {
 | 
				
			||||||
 | 
								this.disableLog = true
 | 
				
			||||||
			return true
 | 
								return true
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// 检查是否在临时黑名单中
 | 
				
			||||||
 | 
						if waf.SharedIPBlackList.Contains(waf.IPTypeAll, firewallconfigs.FirewallScopeService, this.Server.Id, this.WAFRemoteIP()) {
 | 
				
			||||||
 | 
							this.disableLog = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if conn != nil {
 | 
				
			||||||
 | 
								trafficConn, ok := conn.(*TrafficConn)
 | 
				
			||||||
 | 
								if ok && !trafficConn.IsClosed() {
 | 
				
			||||||
 | 
									_ = trafficConn.Close()
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 当前服务的独立设置
 | 
						// 当前服务的独立设置
 | 
				
			||||||
	if this.web.FirewallPolicy != nil && this.web.FirewallPolicy.IsOn {
 | 
						if this.web.FirewallPolicy != nil && this.web.FirewallPolicy.IsOn {
 | 
				
			||||||
		blocked, breakChecking := this.checkWAFRequest(this.web.FirewallPolicy)
 | 
							blocked, breakChecking := this.checkWAFRequest(this.web.FirewallPolicy)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user