]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] One more trailing slash fix + tests
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Feb 2020 17:32:09 +0000 (17:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Feb 2020 17:32:09 +0000 (17:32 +0000)
src/libserver/http/http_util.c
test/lua/unit/url.lua

index f9e5b3e7764ff26c2bb57b83efb68b1839ef4507..ec9d9fa584fd665f849524a0899b6f3daa90e21f 100644 (file)
@@ -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;
        }
 
index 92709b365dfea5fb9cec7e0d980ae818a283dc61..583502c488460979d6ae014fd9dfc7c0d0adf9b3 100644 (file)
@@ -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"},