mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Fix parsing of boundary for multipart/form-data
This commit is contained in:
parent
25ef07b1ec
commit
45a2aab66c
1 changed files with 7 additions and 1 deletions
8
xs_url.h
8
xs_url.h
|
@ -107,7 +107,13 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
|
||||||
if (xs_list_len(l1) != 2)
|
if (xs_list_len(l1) != 2)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
boundary = xs_fmt("--%s", xs_list_get(l1, 1));
|
boundary = xs_dup(xs_list_get(l1, 1));
|
||||||
|
|
||||||
|
/* Tokodon sends the boundary header with double quotes surrounded */
|
||||||
|
if (xs_starts_and_ends("\"", boundary, "\"") != 0)
|
||||||
|
boundary = xs_strip_chars_i(boundary, "\"");
|
||||||
|
|
||||||
|
boundary = xs_fmt("--%s", boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
bsz = strlen(boundary);
|
bsz = strlen(boundary);
|
||||||
|
|
Loading…
Reference in a new issue