mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Provides a common function, url.get_default_port(), for obtaining
the default port number for a given scheme. Fixes #781
This commit is contained in:
@@ -59,13 +59,7 @@ local function dbgt(tbl)
|
||||
end
|
||||
|
||||
local function getHostPort(parsed)
|
||||
local host, port = parsed.host, parsed.port
|
||||
-- if no port was found, try to deduce it from the scheme
|
||||
if ( not(port) ) then
|
||||
port = (parsed.scheme == 'https') and 443
|
||||
port = port or ((parsed.scheme == 'http') and 80)
|
||||
end
|
||||
return host, port
|
||||
return parsed.host, parsed.port or url.get_default_port(parsed.scheme)
|
||||
end
|
||||
|
||||
local function isRedirect(status)
|
||||
|
||||
Reference in New Issue
Block a user