sprockets / sprockets.mixins.mediatype

Handles Content-Type & Accept header serialization and deserialization for you
https://sprocketsmixinsmedia-type.readthedocs.io
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

`get_request_body` should catch `TypeError` in addition to `ValueError` #42

Open dave-shawley opened 3 years ago

dave-shawley commented 3 years ago

https://github.com/sprockets/sprockets.mixins.mediatype/blob/4dbc74076dd31c05009f52fdac58c5fc72cc6fe0/sprockets/mixins/mediatype/content.py#L367-L371

If the default content type is unset, then content_type will be None and parse_content_type will raise a TypeError instead of a ValueError. In either case, we should be responding with a "client error".