aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-23 13:27:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-23 13:27:45 +0000
commitd050686aee0ad85364ceae6185c1e2698feb3e6e (patch)
tree48b7b47b1f55b27a87d6ebcf3a62f5bc2a75ad72 /src/libutil/http.c
parent1762eb9af61997d9acc3017e2e0fc6153b09acc2 (diff)
downloadrspamd-d050686aee0ad85364ceae6185c1e2698feb3e6e.tar.gz
rspamd-d050686aee0ad85364ceae6185c1e2698feb3e6e.zip
[Feature] Add url encoding function
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r--src/libutil/http.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index eec53b515..9a33b1a90 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -27,6 +27,7 @@
#include "unix-std.h"
#include "libutil/ssl_util.h"
#include "libutil/regexp.h"
+#include "libserver/url.h"
#define ENCRYPTED_VERSION " HTTP/1.0"
@@ -3376,7 +3377,7 @@ rspamd_http_message_parse_query (struct rspamd_http_message *msg)
/* We have a single parameter without a value */
key = rspamd_fstring_new_init (c, p - c);
key_tok = rspamd_ftok_map (key);
- key_tok->len = rspamd_decode_url (key->str, key->str,
+ key_tok->len = rspamd_url_decode (key->str, key->str,
key->len);
value = rspamd_fstring_new_init ("", 0);
@@ -3389,7 +3390,7 @@ rspamd_http_message_parse_query (struct rspamd_http_message *msg)
/* We have something like key=value */
key = rspamd_fstring_new_init (c, p - c);
key_tok = rspamd_ftok_map (key);
- key_tok->len = rspamd_decode_url (key->str, key->str,
+ key_tok->len = rspamd_url_decode (key->str, key->str,
key->len);
state = parse_eqsign;
@@ -3415,7 +3416,7 @@ rspamd_http_message_parse_query (struct rspamd_http_message *msg)
if (p > c) {
value = rspamd_fstring_new_init (c, p - c);
value_tok = rspamd_ftok_map (value);
- value_tok->len = rspamd_decode_url (value->str,
+ value_tok->len = rspamd_url_decode (value->str,
value->str,
value->len);
/* Detect quotes for value */