mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-10-05 13:27:24 +03:00
fix empty host
This commit is contained in:
parent
da34530300
commit
3e0593b81b
@ -1759,10 +1759,13 @@ retry:
|
||||
if target.CustomIP != "" {
|
||||
ip = target.CustomIP
|
||||
} else {
|
||||
// hp.Dialer.GetDialedIP would return only the last dialed one
|
||||
ip = hp.Dialer.GetDialedIP(URL.Host)
|
||||
if ip == "" {
|
||||
if onlyHost, _, err := net.SplitHostPort(URL.Host); err == nil {
|
||||
onlyHost, _, err := net.SplitHostPort(URL.Host)
|
||||
if iputil.IsIP(onlyHost) && err == nil {
|
||||
ip = URL.Host
|
||||
} else {
|
||||
// hp.Dialer.GetDialedIP would return only the last dialed one
|
||||
ip = hp.Dialer.GetDialedIP(URL.Host)
|
||||
if ip == "" {
|
||||
ip = hp.Dialer.GetDialedIP(onlyHost)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user