commit 45a2aab
Louis Brauer
·
2024-05-28 00:15:53 +0000 UTC
parent 25ef07b
Fix parsing of boundary for multipart/form-data
1 files changed,
+7,
-1
M
xs_url.h
M
xs_url.h
+7,
-1
1@@ -107,7 +107,13 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
2 if (xs_list_len(l1) != 2)
3 return NULL;
4
5- boundary = xs_fmt("--%s", xs_list_get(l1, 1));
6+ boundary = xs_dup(xs_list_get(l1, 1));
7+
8+ /* Tokodon sends the boundary header with double quotes surrounded */
9+ if (xs_starts_and_ends("\"", boundary, "\"") != 0)
10+ boundary = xs_strip_chars_i(boundary, "\"");
11+
12+ boundary = xs_fmt("--%s", boundary);
13 }
14
15 bsz = strlen(boundary);