Skip to content

Commit

Permalink
Add compat for Content-Disposition
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Mar 6, 2024
1 parent b2bd7b7 commit 2c2107f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/upload-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,11 @@ get_mime_header_param_value (const char *param)
char *first_quote, *last_quote;
char *value;

// param may not start with double quotes.
first_quote = strchr (param, '\"');
if (!first_quote) {
return g_strdup (param);
}
last_quote = strrchr (param, '\"');
if (!first_quote || !last_quote || first_quote == last_quote) {
seaf_debug ("[upload] Invalid mime param %s.\n", param);
Expand Down Expand Up @@ -1869,7 +1873,8 @@ parse_mime_header (evhtp_request_t *req, char *header, RecvFSM *fsm)
}

*colon = 0;
if (strcmp (header, "Content-Disposition") == 0) {
// Content-Disposition is case-insensitive.
if (strcasecmp (header, "Content-Disposition") == 0) {
params = g_strsplit (colon + 1, ";", 3);
for (p = params; *p != NULL; ++p)
*p = g_strstrip (*p);
Expand Down

0 comments on commit 2c2107f

Please sign in to comment.