Allow empty path in url.parse.

I got a redirect of "?p=indisponible" and url.parse returned
{query="p=indisponible"}. Now it returns
{path="", query="p=indisponible"}.
This commit is contained in:
david 2013-02-07 22:37:38 +00:00
parent 4cdb5301dd
commit a210d38769

View file

@ -178,7 +178,7 @@ function parse(url, default)
return ""
end)
-- path is whatever was left
if url ~= "" then parsed.path = url end
parsed.path = url
local authority = parsed.authority
if not authority then return parsed end
authority = string.gsub(authority,"^([^@]*)@",