diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 15918d3ee5..ddbf1b1a74 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -469,8 +469,6 @@ static int get_param_part(struct OperationConfig *config, char endchar, char *endpos; char *tp; char sep; - char type_major[128] = ""; - char type_minor[128] = ""; char *endct = NULL; struct curl_slist *headers = NULL; @@ -502,18 +500,10 @@ static int get_param_part(struct OperationConfig *config, char endchar, /* set type pointer */ type = p; - /* verify that this is a fine type specifier */ - if(2 != sscanf(type, "%127[^/ ]/%127[^;, \n]", type_major, type_minor)) { - warnf(config->global, "Illegally formatted content-type field"); - curl_slist_free_all(headers); - return -1; /* illegal content-type syntax! */ - } - - /* now point beyond the content-type specifier */ - p = type + strlen(type_major) + strlen(type_minor) + 1; - for(endct = p; *p && *p != ';' && *p != endchar; p++) - if(!ISSPACE(*p)) - endct = p + 1; + /* find end of content-type */ + while(*p && (ISALPHA(*p) || (*p == '/') || (*p == '-'))) + p++; + endct = p; sep = *p; } else if(checkprefix("filename=", p)) {