From ba5cbb6d828165a43826c6afdd71fa2edbdca302 Mon Sep 17 00:00:00 2001 From: Nicolai Dagestad Date: Sun, 15 Sep 2024 15:03:21 +0200 Subject: 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. --- xs_url.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xs_url.h') 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) const xs_val *v; xs_list_foreach(args, v) { - xs *kv = xs_split_n(v, "=", 1); + xs *kv = xs_split_n(xs_url_dec(v), "=", 1); if (xs_list_len(kv) == 2) { const char *key = xs_list_get(kv, 0); -- cgit v1.2.3