-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a test that shows bug #1403 #1407
base: master
Are you sure you want to change the base?
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