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: 1.0.0~516 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90dcb6668f2d3ac742ceba19ab7440d81f5b24aa;p=thirdparty%2Frspamd.git Fix parsing of urls with '?' at the end of hostname. --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 9a7468fbff..64b885ba2b 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