mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 19:09:01 +00:00
Handle redirect URLs without a host, e.g. https:///path
This commit is contained in:
@@ -222,8 +222,10 @@ function parse(url, default)
|
||||
authority = string.gsub(authority, ":(%d+)$",
|
||||
function(p) parsed.port = tonumber(p); return "" end)
|
||||
if authority ~= "" then parsed.host = authority end
|
||||
-- TODO: Allow other Unicode encodings
|
||||
parsed.ascii_host = idna.toASCII(unicode.decode(parsed.host, unicode.utf8_dec))
|
||||
if parsed.host then
|
||||
-- TODO: Allow other Unicode encodings
|
||||
parsed.ascii_host = idna.toASCII(unicode.decode(parsed.host, unicode.utf8_dec))
|
||||
end
|
||||
local userinfo = parsed.userinfo
|
||||
if not userinfo then return parsed end
|
||||
userinfo = string.gsub(userinfo, ":([^:]*)$",
|
||||
|
||||
Reference in New Issue
Block a user