char *endpos;
char *tp;
char sep;
- char type_major[128] = "";
- char type_minor[128] = "";
char *endct = NULL;
struct curl_slist *headers = NULL;
/* 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)) {