Allow ignoring params in http_parse_media_type()
This commit is contained in:
parent
ad143fd8c0
commit
a34ce0b6b8
|
@ -409,6 +409,7 @@ http_parse_media_type_parameter
|
||||||
{
|
{
|
||||||
case HTTP_T_TOKEN:
|
case HTTP_T_TOKEN:
|
||||||
case HTTP_T_QUOTED_STRING:
|
case HTTP_T_QUOTED_STRING:
|
||||||
|
if (parameters)
|
||||||
str_map_set (parameters, attribute, xstrdup (t->string.str));
|
str_map_set (parameters, attribute, xstrdup (t->string.str));
|
||||||
result = true;
|
result = true;
|
||||||
default:
|
default:
|
||||||
|
@ -420,8 +421,9 @@ end:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parser for "Content-Type". @a type and @a subtype may be non-NULL
|
/// Parser for "Content-Type". @a type and @a subtype may end up non-NULL
|
||||||
/// even if the function fails. @a parameters should be case-insensitive.
|
/// even if the function fails. @a parameters should be case-insensitive,
|
||||||
|
/// and may be NULL for validation only.
|
||||||
static bool
|
static bool
|
||||||
http_parse_media_type (const char *media_type,
|
http_parse_media_type (const char *media_type,
|
||||||
char **type, char **subtype, struct str_map *parameters)
|
char **type, char **subtype, struct str_map *parameters)
|
||||||
|
|
Loading…
Reference in New Issue