Skip to content
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

Fix MethodOverride EOFError failure #1137

Merged
merged 3 commits into from Dec 29, 2016

Conversation

carlzulauf
Copy link
Contributor

Invalid multipart params should not bubble an error out of the middleware stack and cause the whole stack to fail, especially not when the middleware in question is just checking to see if there is a method override parameter.

Instead of failing outright and requiring additional middleware to capture and handle the EOFError raised by Rack::Multipart::Parser, this pull changes the Rack::MethodOverride middleware to record the error and move on. Based on similar behavior found in Rack::Sendfile, this change writes the errors to env[RACK_ERRORS].

For users who want the error to bubble or want to handle the invalid multipart params differently, an additional/custom middleware would be the appropriate solution instead of relying on a side effect of MethodOverride.

Fixes #903

@rafaelfranca rafaelfranca merged commit bfd4c15 into rack:master Dec 29, 2016
eileencodes added a commit to eileencodes/rack that referenced this pull request Feb 26, 2018
Original commit message:
Fix MethodOverride EOFError failure

Converted changes from Rack 2.0 to work in Rack 1.6 which included
changing `RACK_ERRORS` to `rack.errors` and fixes to the tests (`it` to
`should` and `must_match` to `should =~`.
eileencodes added a commit that referenced this pull request Feb 27, 2018
Backport pull request #1137 from unabridged/fix-eof-failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants