]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parsing of URLs with username
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 24 Nov 2016 14:04:25 +0000 (14:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 24 Nov 2016 14:04:25 +0000 (14:04 +0000)
src/libserver/url.c

index c66728aff8f823af38cec38805ef407ca614d940..1afde3b6bc8b48152c96aa7ae984af99df9633ee 100644 (file)
@@ -867,6 +867,12 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
                                        if (is_url_end (t)) {
                                                goto set;
                                        }
+                                       else if (*p == '@' && !user_seen) {
+                                               /* We need to fallback and test user */
+                                               p = slash;
+                                               user_seen = TRUE;
+                                               st = parse_user;
+                                       }
                                        else if (*p != '.' && *p != '-' && *p != '_' && *p != '%') {
                                                uc = g_utf8_get_char_validated (p, last - p);