svn_mime_type_validate

Function svn_mime_type_validate 

Source
pub unsafe extern "C" fn svn_mime_type_validate(
    mime_type: *const c_char,
    pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Validate @a mime_type.

If @a mime_type does not contain a “/”, or ends with non-alphanumeric data, return #SVN_ERR_BAD_MIME_TYPE, else return success.

Use @a pool only to find error allocation.

Goal: to match both “foo/bar” and “foo/bar; charset=blah”, without being too strict about it, but to disallow mime types that have quotes, newlines, or other garbage on the end, such as might be unsafe in an HTTP header.