diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2022-03-18 12:12:39 +0100 |
|---|---|---|
| committer | Caleb Maclennan <caleb@alerque.com> | 2022-03-19 17:13:15 +0300 |
| commit | 601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1 (patch) | |
| tree | e3b9c152b9ff8a431d1431edb0a42d051d256f13 /src/url.lua | |
| parent | 480c05257211b3e566f33fdf8cf051233e2dab30 (diff) | |
| download | luasocket-601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1.tar.gz luasocket-601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1.tar.bz2 luasocket-601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1.zip | |
refactor: Address issues raised by linter
Diffstat (limited to 'src/url.lua')
| -rw-r--r-- | src/url.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/url.lua b/src/url.lua index 0a3a80a..8e0dc5c 100644 --- a/src/url.lua +++ b/src/url.lua | |||
| @@ -179,9 +179,9 @@ function _M.parse(url, default) | |||
| 179 | function(u) parsed.userinfo = u; return "" end) | 179 | function(u) parsed.userinfo = u; return "" end) |
| 180 | authority = string.gsub(authority, ":([^:%]]*)$", | 180 | authority = string.gsub(authority, ":([^:%]]*)$", |
| 181 | function(p) parsed.port = p; return "" end) | 181 | function(p) parsed.port = p; return "" end) |
| 182 | if authority ~= "" then | 182 | if authority ~= "" then |
| 183 | -- IPv6? | 183 | -- IPv6? |
| 184 | parsed.host = string.match(authority, "^%[(.+)%]$") or authority | 184 | parsed.host = string.match(authority, "^%[(.+)%]$") or authority |
| 185 | end | 185 | end |
| 186 | local userinfo = parsed.userinfo | 186 | local userinfo = parsed.userinfo |
| 187 | if not userinfo then return parsed end | 187 | if not userinfo then return parsed end |
| @@ -264,7 +264,7 @@ function _M.absolute(base_url, relative_url) | |||
| 264 | relative_parsed.query = base_parsed.query | 264 | relative_parsed.query = base_parsed.query |
| 265 | end | 265 | end |
| 266 | end | 266 | end |
| 267 | else | 267 | else |
| 268 | relative_parsed.path = absolute_path(base_parsed.path or "", | 268 | relative_parsed.path = absolute_path(base_parsed.path or "", |
| 269 | relative_parsed.path) | 269 | relative_parsed.path) |
| 270 | end | 270 | end |
