mirror of
https://github.com/nmap/nmap.git
synced 2025-12-26 01:19:03 +00:00
Changes the port type returned from url.parse() to an actual integer, as
opposed to a string that represents an integer. Fixes #833, fixes #817.
This commit is contained in:
@@ -183,8 +183,8 @@ function parse(url, default)
|
||||
if not authority then return parsed end
|
||||
authority = string.gsub(authority,"^([^@]*)@",
|
||||
function(u) parsed.userinfo = u; return "" end)
|
||||
authority = string.gsub(authority, ":([0-9]*)$",
|
||||
function(p) if p ~= "" then parsed.port = p end; return "" end)
|
||||
authority = string.gsub(authority, ":(%d+)$",
|
||||
function(p) parsed.port = tonumber(p); return "" end)
|
||||
if authority ~= "" then parsed.host = authority end
|
||||
local userinfo = parsed.userinfo
|
||||
if not userinfo then return parsed end
|
||||
|
||||
Reference in New Issue
Block a user