refactor: Address issues raised by linter

This commit is contained in:
Thijs Schreijer 2022-03-18 12:12:39 +01:00 committed by Caleb Maclennan
parent 480c052572
commit 601ad8d59f
No known key found for this signature in database
GPG key ID: B538286DE04ECFE5
21 changed files with 187 additions and 198 deletions

View file

@ -179,9 +179,9 @@ function _M.parse(url, default)
function(u) parsed.userinfo = u; return "" end)
authority = string.gsub(authority, ":([^:%]]*)$",
function(p) parsed.port = p; return "" end)
if authority ~= "" then
if authority ~= "" then
-- IPv6?
parsed.host = string.match(authority, "^%[(.+)%]$") or authority
parsed.host = string.match(authority, "^%[(.+)%]$") or authority
end
local userinfo = parsed.userinfo
if not userinfo then return parsed end
@ -264,7 +264,7 @@ function _M.absolute(base_url, relative_url)
relative_parsed.query = base_parsed.query
end
end
else
else
relative_parsed.path = absolute_path(base_parsed.path or "",
relative_parsed.path)
end