commit be9abe7: [Minor] Fixes in urls fragments/queries parsing
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Jan 10 16:21:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-01-10 16:16:41 +0000
URL: https://github.com/rspamd/rspamd/commit/be9abe795333dd76eaab83c2d765eefe98b10db7
[Minor] Fixes in urls fragments/queries parsing
---
src/libserver/url.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/libserver/url.c b/src/libserver/url.c
index c2f59e768..bb32063d7 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -1021,6 +1021,14 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
st = parse_path;
c = p + 1;
}
+ else if (*p == '?') {
+ st = parse_query;
+ c = p + 1;
+ }
+ else if (*p == '#') {
+ st = parse_part;
+ c = p + 1;
+ }
else if (p != last) {
goto out;
}
@@ -1359,6 +1367,14 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
c = p + 1;
st = parse_query;
}
+ else if (t == '#') {
+ /* No query, just fragment */
+ if (p - c != 0) {
+ SET_U (u, UF_PATH);
+ }
+ c = p + 1;
+ st = parse_part;
+ }
else if (is_url_end (t)) {
goto set;
}
More information about the Commits
mailing list