1
0
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:
nnposter
2017-04-19 18:00:36 +00:00
parent af6bbc35bb
commit e80976a13a
10 changed files with 41 additions and 77 deletions

View File

@@ -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