diff options
| author | 2024-05-28 02:15:53 +0200 | |
|---|---|---|
| committer | 2024-05-28 02:15:53 +0200 | |
| commit | 45a2aab66cbcb8e6d9286dcbfe19d1a310833061 (patch) | |
| tree | a62015f6c510fff4e6ca5561c994d31a31039648 | |
| parent | More or less smaller fixes :) (diff) | |
| download | penes-snac2-45a2aab66cbcb8e6d9286dcbfe19d1a310833061.tar.gz penes-snac2-45a2aab66cbcb8e6d9286dcbfe19d1a310833061.tar.xz penes-snac2-45a2aab66cbcb8e6d9286dcbfe19d1a310833061.zip | |
Fix parsing of boundary for multipart/form-data
| -rw-r--r-- | xs_url.h | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -107,7 +107,13 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea | |||
| 107 | if (xs_list_len(l1) != 2) | 107 | if (xs_list_len(l1) != 2) |
| 108 | return NULL; | 108 | return NULL; |
| 109 | 109 | ||
| 110 | boundary = xs_fmt("--%s", xs_list_get(l1, 1)); | 110 | boundary = xs_dup(xs_list_get(l1, 1)); |
| 111 | |||
| 112 | /* Tokodon sends the boundary header with double quotes surrounded */ | ||
| 113 | if (xs_starts_and_ends("\"", boundary, "\"") != 0) | ||
| 114 | boundary = xs_strip_chars_i(boundary, "\""); | ||
| 115 | |||
| 116 | boundary = xs_fmt("--%s", boundary); | ||
| 111 | } | 117 | } |
| 112 | 118 | ||
| 113 | bsz = strlen(boundary); | 119 | bsz = strlen(boundary); |