diff options
-rw-r--r-- | src/url.lua | 2 | ||||
-rw-r--r-- | test/urltest.lua | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/url.lua b/src/url.lua index a354ab5..0d88adb 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -94,7 +94,7 @@ local function remove_dot_components(path) | |||
94 | path = path:gsub('[^/]+/%.%./*$', '') | 94 | path = path:gsub('[^/]+/%.%./*$', '') |
95 | path = path:gsub('/%.%.$', '/') | 95 | path = path:gsub('/%.%.$', '/') |
96 | path = path:gsub('/%.$', '/') | 96 | path = path:gsub('/%.$', '/') |
97 | path = path:gsub('^/%.%.', '') | 97 | path = path:gsub('^/%.%./', '/') |
98 | return path | 98 | return path |
99 | end | 99 | end |
100 | 100 | ||
diff --git a/test/urltest.lua b/test/urltest.lua index 649be88..8664fa6 100644 --- a/test/urltest.lua +++ b/test/urltest.lua | |||
@@ -685,6 +685,7 @@ check_absolute_url("a/b/c/d/../", "d/e/f", "a/b/c/d/e/f") | |||
685 | check_absolute_url("http://velox.telemar.com.br", "/dashboard/index.html", | 685 | check_absolute_url("http://velox.telemar.com.br", "/dashboard/index.html", |
686 | "http://velox.telemar.com.br/dashboard/index.html") | 686 | "http://velox.telemar.com.br/dashboard/index.html") |
687 | check_absolute_url("http://example.com/", "../.badhost.com/", "http://example.com/.badhost.com/") | 687 | check_absolute_url("http://example.com/", "../.badhost.com/", "http://example.com/.badhost.com/") |
688 | check_absolute_url("http://example.com/", "...badhost.com/", "http://example.com/...badhost.com/") | ||
688 | 689 | ||
689 | print("testing path parsing and composition") | 690 | print("testing path parsing and composition") |
690 | check_parse_path("/eu/tu/ele", { "eu", "tu", "ele"; is_absolute = 1 }) | 691 | check_parse_path("/eu/tu/ele", { "eu", "tu", "ele"; is_absolute = 1 }) |