mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31: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:
@@ -49,14 +49,9 @@ portrule = shortport.http
|
||||
local dbg = stdnse.debug2
|
||||
|
||||
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 getReflected(parsed, r)
|
||||
local reflected_values,not_reflected_values = {},{}
|
||||
local count = 0
|
||||
|
||||
Reference in New Issue
Block a user