diff options
author | E. Westbrook <github@westbrook.io> | 2018-08-21 10:43:04 -0600 |
---|---|---|
committer | E. Westbrook <github@westbrook.io> | 2018-08-21 10:43:04 -0600 |
commit | 5b862e6a3c79b8e336a0ac2f0d23ca69993b326d (patch) | |
tree | fcd0f439eb2a626ebd333917ac62c2df70470dc3 /src | |
parent | 7ccea58776b8084f29a48610cb44b17ca604e4b5 (diff) | |
download | luasocket-5b862e6a3c79b8e336a0ac2f0d23ca69993b326d.tar.gz luasocket-5b862e6a3c79b8e336a0ac2f0d23ca69993b326d.tar.bz2 luasocket-5b862e6a3c79b8e336a0ac2f0d23ca69993b326d.zip |
url.lua:absolute_path(): ensure a separator between base_path and relative_path
Diffstat (limited to 'src')
-rw-r--r-- | src/url.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/url.lua b/src/url.lua index e1fa2bc..243ee1c 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -110,6 +110,7 @@ local function absolute_path(base_path, relative_path) | |||
110 | if string.sub(relative_path, 1, 1) == "/" then | 110 | if string.sub(relative_path, 1, 1) == "/" then |
111 | return remove_dot_components(relative_path) end | 111 | return remove_dot_components(relative_path) end |
112 | base_path = base_path:gsub("[^/]*$", "") | 112 | base_path = base_path:gsub("[^/]*$", "") |
113 | if not base_path:find'/$' then base_path = base_path .. '/' end | ||
113 | local path = base_path .. relative_path | 114 | local path = base_path .. relative_path |
114 | path = remove_dot_components(path) | 115 | path = remove_dot_components(path) |
115 | return path | 116 | return path |