From 03403bb66b7b269af10caeb716213d47c8407a6c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 11 Dec 2017 00:41:40 +0100 Subject: [PATCH] trim space before parsing address --- common/net/address.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/net/address.go b/common/net/address.go index 993bf814b..cad58edf7 100644 --- a/common/net/address.go +++ b/common/net/address.go @@ -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 {