From: Vsevolod Stakhov Date: Tue, 23 Jun 2015 11:08:21 +0000 (+0100) Subject: Fix parsing of urls with '?' at the end of hostname. X-Git-Tag: 0.9.7~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8839234580fcdf81c617cef10e66541120791863;p=rspamd.git Fix parsing of urls with '?' at the end of hostname. --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 2bab0ca4f..5c2bc7437 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -692,7 +692,7 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, } break; case parse_domain: - if (t == '/' || t == ':') { + if (t == '/' || t == ':' || t == '?') { if (p - c == 0) { goto out; } @@ -700,6 +700,11 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, SET_U (u, UF_HOST); st = parse_suffix_slash; } + else if (t == '?') { + SET_U (u, UF_HOST); + st = parse_query; + c = p + 1; + } else if (!user_seen) { /* * Here we can have both port and password, hence we need