Remove superflous brackets; fix DoH default port as well
This commit is contained in:
parent
86fb695189
commit
1f81710b91
|
@ -99,7 +99,7 @@ func newDNSCryptServerStamp(bin []byte) (ServerStamp, error) {
|
|||
pos++
|
||||
stamp.serverAddrStr = string(bin[pos : pos+len])
|
||||
pos += len
|
||||
if (net.ParseIP(strings.TrimRight(strings.TrimLeft(stamp.serverAddrStr, "["), "]"))) != nil {
|
||||
if net.ParseIP(strings.TrimRight(strings.TrimLeft(stamp.serverAddrStr, "["), "]")) != nil {
|
||||
stamp.serverAddrStr = fmt.Sprintf("%s:%d", stamp.serverAddrStr, DefaultPort)
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ func newDoHServerStamp(bin []byte) (ServerStamp, error) {
|
|||
pos++
|
||||
stamp.serverAddrStr = string(bin[pos : pos+len])
|
||||
pos += len
|
||||
if net.ParseIP(stamp.serverAddrStr) != nil {
|
||||
if net.ParseIP(strings.TrimRight(strings.TrimLeft(stamp.serverAddrStr, "["), "]")) != nil {
|
||||
stamp.serverAddrStr = fmt.Sprintf("%s:%d", stamp.serverAddrStr, DefaultPort)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue