Merge pull request #418 from alerque/url-empty-path

This commit is contained in:
Caleb Maclennan 2023-11-09 14:11:33 +03:00 committed by GitHub
commit 8a5368b659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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