Skip to content

Inconsistent behaviour when responding to requests w/ invalid Content-Type #2886

Closed Answered by the10thWiz
raif-s-naffah asked this question in Questions
Discussion options

You must be logged in to vote

There are two options. You could add a secondary route (or a blanket, low ranked route) that catches invalid content-types, and returns a 400.

The other option, and the one I think makes more sense long term, is to add support for this in Rocket. Rocket parses a number of headers by default, and I think a parse error in any of them should cause the default error type to be a 400, rather than the current default of 404. If you're interested, we would accept a PR that implements this behavior.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by raif-s-naffah
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants