mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-04-28 03:20:10 +00:00
Add compat for Content-Disposition (#650)
Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
parent
b2bd7b7b6b
commit
ef239b890d
@ -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);
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user