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