aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 12:08:21 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 12:08:21 +0100
commit90dcb6668f2d3ac742ceba19ab7440d81f5b24aa (patch)
treeabd7bbae9f158690c69beb2d531cd6db606b7a00
parentd17ea56136824abb4ca406d3902e75cebeefc812 (diff)
downloadrspamd-90dcb6668f2d3ac742ceba19ab7440d81f5b24aa.tar.gz
rspamd-90dcb6668f2d3ac742ceba19ab7440d81f5b24aa.zip
Fix parsing of urls with '?' at the end of hostname.
-rw-r--r--src/libserver/url.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 9a7468fbf..64b885ba2 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