From 814c0d16ad4a3ff44b09879e0d7b5aafbe7a941d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 18 Feb 2020 17:05:27 +0000 Subject: [Minor] Fix trailing slash normalisation --- src/libserver/http/http_util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libserver/http') diff --git a/src/libserver/http/http_util.c b/src/libserver/http/http_util.c index 89e74a94b..f9e5b3e77 100644 --- a/src/libserver/http/http_util.c +++ b/src/libserver/http/http_util.c @@ -497,6 +497,17 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen) } } break; + case st_got_dot: + if (slash) { + /* /. -> must be / */ + *o++ = '/'; + } + else { + if (o > path) { + *o++ = '.'; + } + } + break; case st_got_slash: *o++ = '/'; break; -- cgit v1.2.3