-
Notifications
You must be signed in to change notification settings - Fork 51
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
POST request with no body results in a rack exception #71
Comments
This should probably also check the content_length before performing any mutation. |
@thexa4 , thank you very much for exposing this issue. 🎉👏🏻🙏🏻👍🏻 You're right, iodine should have returned an empty string ( I posted an initial patch and I hope to release it soon, after running a few tests. I'm not sure what you meant by suggesting to test the I'm assuming you were suggesting a way to patch Rack... and although I think your instincts are great, 99.9% of all POST requests probably contain some data. I think it's fair that Rack would upstream the edge-case handling to the server. |
Patch released. closing issue. Thanks again! 🙏🏻👍🏻🎉 |
@boazsegev you're absolutely right on my intention with that comment, and I agree that this edge case can be handled here, in iodine :). Thank you for the blazingly fast update ❤️ The biggest issue I have with the rack implementation is that the comment for the rack functionality says it's supposed to check if there is data, whereas it's actually checking if there could be data -- and then it's further assumed that there is data. |
@SleeplessByte - yes, I agree... the Rack documentation could be improved. On the other hand, Rack was a huge undertaking and it's so relied upon that it became practically impossible to replace. It's battle tested and dependable. No matter how many of us complain about Rack's CGI core, it's probably here to stay and it's making many developers happy. |
It makes me happy 😉 so it gets my upvote regardless of the 🆗 documentation. |
Steps to reproduce:
rails new proofofconcept
cd proofofconcept
rails s &
curl -XPOST http://localhost:3000
-> '404'iodine &
curl -XPOST http://localhost:3000
-> '500'Results in the following exception:
This seems to happen due to this line: https://github.com/rack/rack/blob/master/lib/rack/request.rb#L352 ,
form_vars
is set to nil byget_header(RACK_INPUT).read
which causes the safari fix check to throw a NoMethodError.The text was updated successfully, but these errors were encountered: