fix(url): Avoid query string being part of authority, allows parsing empty paths

This commit is contained in:
Caleb Maclennan 2023-11-08 14:50:43 +03:00
parent bef62aeb50
commit 7eaf648056
No known key found for this signature in database
GPG Key ID: B538286DE04ECFE5

View File

@ -152,7 +152,7 @@ function _M.parse(url, default)
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
function(s) parsed.scheme = s; return "" end)
-- get authority
url = string.gsub(url, "^//([^/]*)", function(n)
url = string.gsub(url, "^//([^/%?]*)", function(n)
parsed.authority = n
return ""
end)