mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Treat empty port in URL the same as absent.
RFC 3986 says that these URLs are equivalent: http://example.com/ http://example.com:/ url.parse was returning port="" for the latter. Make it instead return port=nil like the former.
This commit is contained in:
parent
1c7c414fbb
commit
ac5a479a73
1 changed files with 1 additions and 1 deletions
|
|
@ -184,7 +184,7 @@ function parse(url, default)
|
|||
authority = string.gsub(authority,"^([^@]*)@",
|
||||
function(u) parsed.userinfo = u; return "" end)
|
||||
authority = string.gsub(authority, ":([0-9]*)$",
|
||||
function(p) parsed.port = p; return "" end)
|
||||
function(p) if p ~= "" then parsed.port = p end; return "" end)
|
||||
if authority ~= "" then parsed.host = authority end
|
||||
local userinfo = parsed.userinfo
|
||||
if not userinfo then return parsed end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue