mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Let http.lua functions optionally connect via any address family
Sometimes (e.g. when using an external API), a script wants to connect by name to a server and doesn't care whether IPv4 or IPv6 is used. By passing the "any_af" option, the first resolved address of any address family will be used, allowing external-category scripts which used to fail with -6 to succeed.
This commit is contained in:
@@ -79,7 +79,7 @@ action = function(host, port)
|
||||
|
||||
stdnse.debug1("Checking host %s", target_url)
|
||||
local qry = build_qry(apikey, target_url)
|
||||
local req = http.get_url(qry)
|
||||
local req = http.get_url(qry, {any_af=true})
|
||||
stdnse.debug2("%s", qry)
|
||||
|
||||
if ( req.status > 400 ) then
|
||||
|
||||
Reference in New Issue
Block a user