add mime media type parsing
avoid double free when uri parsing fails
decode the Content-Type header as a mime media type