Skip to content

Commit

Permalink
trim space before parsing address
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Dec 10, 2017
1 parent 742d9d2 commit 03403bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/net/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package net

import (
"net"
"strings"

"v2ray.com/core/app/log"
"v2ray.com/core/common/predicate"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 03403bb

Please sign in to comment.