From 8839234580fcdf81c617cef10e66541120791863 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 23 Jun 2015 12:08:21 +0100 Subject: [PATCH] Fix parsing of urls with '?' at the end of hostname. --- src/libserver/url.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5