diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-18 17:32:09 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-18 17:32:09 +0000 |
commit | edc8253e016cb823c08cbe81c47e536b6842f786 (patch) | |
tree | 0f9906eaa2f6e6a21785cfdabfbe0bedb6d1510e | |
parent | 814c0d16ad4a3ff44b09879e0d7b5aafbe7a941d (diff) | |
download | rspamd-edc8253e016cb823c08cbe81c47e536b6842f786.tar.gz rspamd-edc8253e016cb823c08cbe81c47e536b6842f786.zip |
[Minor] One more trailing slash fix + tests
-rw-r--r-- | src/libserver/http/http_util.c | 2 | ||||
-rw-r--r-- | test/lua/unit/url.lua | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libserver/http/http_util.c b/src/libserver/http/http_util.c index f9e5b3e77..ec9d9fa58 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 92709b365..583502c48 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"}, |