mirror of
				https://github.com/v2fly/v2ray-core.git
				synced 2025-10-31 09:49:40 +00:00 
			
		
		
		
	trim space before parsing address
This commit is contained in:
		
							parent
							
								
									742d9d25d1
								
							
						
					
					
						commit
						03403bb66b
					
				| @ -2,6 +2,7 @@ package net | |||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"net" | 	"net" | ||||||
|  | 	"strings" | ||||||
| 
 | 
 | ||||||
| 	"v2ray.com/core/app/log" | 	"v2ray.com/core/app/log" | ||||||
| 	"v2ray.com/core/common/predicate" | 	"v2ray.com/core/common/predicate" | ||||||
| @ -78,6 +79,7 @@ func ParseAddress(addr string) Address { | |||||||
| 	if lenAddr > 0 && addr[0] == '[' && addr[lenAddr-1] == ']' { | 	if lenAddr > 0 && addr[0] == '[' && addr[lenAddr-1] == ']' { | ||||||
| 		addr = addr[1 : lenAddr-1] | 		addr = addr[1 : lenAddr-1] | ||||||
| 	} | 	} | ||||||
|  | 	addr = strings.TrimSpace(addr) | ||||||
| 
 | 
 | ||||||
| 	ip := net.ParseIP(addr) | 	ip := net.ParseIP(addr) | ||||||
| 	if ip != nil { | 	if ip != nil { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Darien Raymond
						Darien Raymond