aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorE. Westbrook <github@westbrook.io>2018-08-21 11:27:42 -0600
committerE. Westbrook <github@westbrook.io>2018-08-21 11:27:42 -0600
commit38d936ec0ea05da9f85a5c582e5073e0d1b82209 (patch)
treed6c3bdd676903f76b3c1977a98fe6087ea0f4f85 /src
parent5b862e6a3c79b8e336a0ac2f0d23ca69993b326d (diff)
downloadluasocket-38d936ec0ea05da9f85a5c582e5073e0d1b82209.tar.gz
luasocket-38d936ec0ea05da9f85a5c582e5073e0d1b82209.tar.bz2
luasocket-38d936ec0ea05da9f85a5c582e5073e0d1b82209.zip
url.lua:remove_dot_components(): empty path component double-dot corner case
Diffstat (limited to 'src')
-rw-r--r--src/url.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/url.lua b/src/url.lua
index 243ee1c..10a9d90 100644
--- a/src/url.lua
+++ b/src/url.lua
@@ -89,6 +89,10 @@ local function remove_dot_components(path)
89 until path == was 89 until path == was
90 repeat 90 repeat
91 local was = path 91 local was = path
92 path = path:gsub('//%.%./([^/]+)', '/%1', 1)
93 until path == was
94 repeat
95 local was = path
92 path = path:gsub('[^/]+/%.%./([^/]+)', '%1', 1) 96 path = path:gsub('[^/]+/%.%./([^/]+)', '%1', 1)
93 until path == was 97 until path == was
94 path = path:gsub('[^/]+/%.%./*$', '') 98 path = path:gsub('[^/]+/%.%./*$', '')