]> source.dussan.org Git - rspamd.git/commitdiff
Fix parsing of urls with '?' at the end of hostname.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Jun 2015 11:08:21 +0000 (12:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 23 Jun 2015 11:08:50 +0000 (12:08 +0100)
src/libserver/url.c

index 2bab0ca4fe58f71728f76c11bbab1a9632b81a8f..5c2bc743728560752355e577ac3769f54e64fe1d 100644 (file)
@@ -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