commit 9283bc3

default  ·  2024-11-11 18:41:43 +0000 UTC
parent 33375ac
Fixed crash in xs_multipart_form_data() (from the tooot application).
1 files changed,  +2, -2
+2, -2
 1@@ -153,7 +153,7 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
 2             memcpy(s1, p, q - p);
 3             s1[q - p] = '\0';
 4 
 5-            if (xs_startswith(s1, "Content-Disposition")) {
 6+            if (xs_startswith(s1, "Content-Disposition") || xs_startswith(s1, "content-disposition")) {
 7                 /* split by " like a primitive man */
 8                 l1 = xs_split(s1, "\"");
 9 
10@@ -167,7 +167,7 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
11                 }
12             }
13             else
14-            if (xs_startswith(s1, "Content-Type")) {
15+            if (xs_startswith(s1, "Content-Type") || xs_startswith(s1, "content-type")) {
16                 l1 = xs_split(s1, ":");
17 
18                 if (xs_list_len(l1) >= 2) {