mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-10-27 02:22:13 +03:00
Fix ip/cname resolve bug
When the url's format like: https://www.google.com:443, the domain pass to the resolver will be www.google.com:443 and can't get the right result This patch split the port at the start of the function and rewrite the domain to the right format, which makes the result of IP/Cname be right.
This commit is contained in:
parent
48f2532f84
commit
28ef5a12e0
@ -520,6 +520,12 @@ retry:
|
||||
URL := fmt.Sprintf("%s://%s", protocol, domain)
|
||||
if port > 0 {
|
||||
URL = fmt.Sprintf("%s://%s:%d", protocol, domain, port)
|
||||
} else {
|
||||
domainParse := strings.Split(domain, ":")
|
||||
domain = domainParse[0]
|
||||
if len(domainParse) > 1 {
|
||||
port, _ = strconv.Atoi(domainParse[1])
|
||||
}
|
||||
}
|
||||
|
||||
if !scanopts.Unsafe {
|
||||
@ -692,7 +698,6 @@ retry:
|
||||
builder.WriteString(" [http2]")
|
||||
}
|
||||
}
|
||||
|
||||
ip := hp.Dialer.GetDialedIP(domain)
|
||||
if scanopts.OutputIP {
|
||||
builder.WriteString(fmt.Sprintf(" [%s]", ip))
|
||||
|
Loading…
Reference in New Issue
Block a user