From: Vsevolod Stakhov Date: Tue, 18 Feb 2020 17:32:09 +0000 (+0000) Subject: [Minor] One more trailing slash fix + tests X-Git-Tag: 2.4~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edc8253e016cb823c08cbe81c47e536b6842f786;p=thirdparty%2Frspamd.git [Minor] One more trailing slash fix + tests --- diff --git a/src/libserver/http/http_util.c b/src/libserver/http/http_util.c index f9e5b3e776..ec9d9fa584 100644 --- a/src/libserver/http/http_util.c +++ b/src/libserver/http/http_util.c @@ -512,9 +512,11 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen) *o++ = '/'; break; default: +#if 0 if (o > path + 1 && *(o - 1) == '/') { o --; } +#endif break; } diff --git a/test/lua/unit/url.lua b/test/lua/unit/url.lua index 92709b365d..583502c488 100644 --- a/test/lua/unit/url.lua +++ b/test/lua/unit/url.lua @@ -56,8 +56,8 @@ context("URL check functions", function() end cases = { - {[[http://example.net/path/.]], true, { - host = 'example.net', path = 'path' + {[[http://example.net/path/]], true, { + host = 'example.net', path = 'path/' }}, {'http://example.net/hello%20world.php?arg=x#fragment', true, { host = 'example.net', fragment = 'fragment', query = 'arg=x', @@ -146,8 +146,8 @@ context("URL check functions", function() {"/././foo", "/foo"}, {"/a/b/c/./../../g", "/a/g"}, {"/./.foo", "/.foo"}, - {"/foo/.", "/foo"}, - {"/foo/./", "/foo"}, + {"/foo/.", "/foo/"}, + {"/foo/./", "/foo/"}, {"/foo/bar/..", "/foo"}, {"/foo/bar/../", "/foo/"}, {"/foo/..bar", "/foo/..bar"},