Skip to content

Commit

Permalink
fix(url): Avoid query string being part of authority, allows parsing …
Browse files Browse the repository at this point in the history
…empty paths
  • Loading branch information
alerque committed Nov 8, 2023
1 parent bef62ae commit 7eaf648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/url.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7eaf648

Please sign in to comment.