diff options
| author | Caleb Maclennan <caleb@alerque.com> | 2022-03-19 17:42:53 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-19 17:42:53 +0300 |
| commit | a36818d3f3afd8758ec10991a5cb08ebdaca6329 (patch) | |
| tree | 445c27832ac4fb48a03c146fa7c797dc4880c099 /src/url.lua | |
| parent | 6952262e6a1315b14935ddd0ea511c202c0154ba (diff) | |
| parent | 8390d07774a1ba1a597d809a1a2562d88ecce19d (diff) | |
| download | luasocket-a36818d3f3afd8758ec10991a5cb08ebdaca6329.tar.gz luasocket-a36818d3f3afd8758ec10991a5cb08ebdaca6329.tar.bz2 luasocket-a36818d3f3afd8758ec10991a5cb08ebdaca6329.zip | |
Merge pull request #354 from lunarmodules/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 |
