mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	remove not needed (#19128)
This commit is contained in:
		@@ -8,8 +8,6 @@ import (
 | 
			
		||||
	"net"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/modules/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// HostMatchList is used to check if a host or IP is in a list.
 | 
			
		||||
@@ -104,11 +102,11 @@ func (hl *HostMatchList) checkIP(ip net.IP) bool {
 | 
			
		||||
	for _, builtin := range hl.builtins {
 | 
			
		||||
		switch builtin {
 | 
			
		||||
		case MatchBuiltinExternal:
 | 
			
		||||
			if ip.IsGlobalUnicast() && !util.IsIPPrivate(ip) {
 | 
			
		||||
			if ip.IsGlobalUnicast() && !ip.IsPrivate() {
 | 
			
		||||
				return true
 | 
			
		||||
			}
 | 
			
		||||
		case MatchBuiltinPrivate:
 | 
			
		||||
			if util.IsIPPrivate(ip) {
 | 
			
		||||
			if ip.IsPrivate() {
 | 
			
		||||
				return true
 | 
			
		||||
			}
 | 
			
		||||
		case MatchBuiltinLoopback:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user