Create a test that shows bug #1403#1407
Conversation
I have created an example that shows that even if it is setted `format :json`, if I send a post request with content_type: application/x-www-form-urlencoded it does return `201`
|
Isn't this what the doc says? "it will not parse any other input than ... application/x-www-form-urlencoded"? The formats apply to parsing, too. The following API will only respond to the JSON content-type and will not parse any other input than application/json, application/x-www-form-urlencoded, multipart/form-data, multipart/related and multipart/mixed. All other requests will fail with an HTTP 406 error code. |
|
Ok, I definitely need a vacation. I have read this sentence hundred times, and all the time I misunderstand it. My bad, sorry this time waste! |
|
It's not obvious that it's supposed to behave this way, I think the biggest reason is simply that Rack does some of the parsing and we can't force it not to. |
|
I would be curious to see what a PR "fixing" this looks like, and would like to open it for discussion. I'm going to reopen this. |
|
Do you mean introducing the case that if using I am not familiar with your codebase, but if you said that if it is due to some |
|
Right, I mean treating this as a bug and fixing it. |
I have created an example that shows that even if it is setted
format :json, if I send a post request with content_type: application/x-www-form-urlencoded it does return201