summaryrefslogtreecommitdiff
path: root/xs_url.h
diff options
context:
space:
mode:
authorGravatar Nicolai Dagestad2024-09-15 15:03:21 +0200
committerGravatar Nicolai Dagestad2024-09-15 18:39:49 +0200
commitba5cbb6d828165a43826c6afdd71fa2edbdca302 (patch)
tree87290e2f2a97433c35f0ce86cd14cabe9703dd2c /xs_url.h
parentMinor code cleaning. (diff)
downloadpenes-snac2-ba5cbb6d828165a43826c6afdd71fa2edbdca302.tar.gz
penes-snac2-ba5cbb6d828165a43826c6afdd71fa2edbdca302.tar.xz
penes-snac2-ba5cbb6d828165a43826c6afdd71fa2edbdca302.zip
URL decode data after splitting the arguments
Data decoding should happen after the parsing if not, a '?', '&', '#' or other character decoded will interfere with the parsing. e.g. the users password contains a '&', then it is truncated on that character, and login will fail.
Diffstat (limited to '')
-rw-r--r--xs_url.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xs_url.h b/xs_url.h
index d6dd47a..a4f9dc1 100644
--- a/xs_url.h
+++ b/xs_url.h
@@ -53,7 +53,7 @@ xs_dict *xs_url_vars(const char *str)
53 const xs_val *v; 53 const xs_val *v;
54 54
55 xs_list_foreach(args, v) { 55 xs_list_foreach(args, v) {
56 xs *kv = xs_split_n(v, "=", 1); 56 xs *kv = xs_split_n(xs_url_dec(v), "=", 1);
57 57
58 if (xs_list_len(kv) == 2) { 58 if (xs_list_len(kv) == 2) {
59 const char *key = xs_list_get(kv, 0); 59 const char *key = xs_list_get(kv, 0);