cleanup: serversInfo: parse host from ServerAddrStr with ExtractHostAndPort
Use only one method to parse host from port.
This commit is contained in:
parent
659ff4b19d
commit
147078d588
|
@ -327,8 +327,7 @@ func fetchDNSCryptServerInfo(proxy *Proxy, name string, stamp stamps.ServerStamp
|
|||
|
||||
func fetchDoHServerInfo(proxy *Proxy, name string, stamp stamps.ServerStamp, isNew bool) (ServerInfo, error) {
|
||||
if len(stamp.ServerAddrStr) > 0 {
|
||||
addrStr := stamp.ServerAddrStr
|
||||
ipOnly := addrStr[:strings.LastIndex(addrStr, ":")]
|
||||
ipOnly, _ := ExtractHostAndPort(stamp.ServerAddrStr, -1)
|
||||
proxy.xTransport.cachedIPs.Lock()
|
||||
proxy.xTransport.cachedIPs.cache[stamp.ProviderName] = ipOnly
|
||||
proxy.xTransport.cachedIPs.Unlock()
|
||||
|
|
Loading…
Reference in New Issue