-
-
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
undefined method `rewind' for #<Rack::Lint::Wrapper::InputWrapper w/Rack >= 3.0 #2388
Comments
This is caused by lack of |
Thank you. I've included minimal example in this gist: https://gist.github.com/andrius/50e2965a9b0936a7c76f9d7f77bdc2a7 To run: docker compose build && docker compose run --rm --interactive --service-ports api To test: curl -X POST \
'http://localhost:3000/v1/users' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"name": "foo", "lastname": "bar", "email": "foo@bar.foo", "telephone": "+1234567890", "role": "user"}' |
Found the issue, rack/rack#1972. Adding require_relative 'api'
use Rack::RewindableInput::Middleware
run API::Root We should do something about this in Grape. Would you like to help @andrius? We have https://github.com/ruby-grape/grape/tree/master/spec/integration/rack/v3 and https://github.com/ruby-grape/grape/blob/master/gemfiles/rack_3_0.gemfile, but we're not catching this error. The first thing to figure out is how to reproduce it in CI, then we can see whether we should just recommend including this middleware manually, or more likely have to write some code to include it when Rack version is >= 3.0. |
Your suggestion with
I will try but it will take time. Just check'ed the GitHub workflows |
I use a simple ruby (not rails) API with grape, grape-entiry and grape-swagger gems, along with the mongoid. For POST or PUT endpoints it does throw the following error:
Based on online search I've found that similar issues were long time ago and were fixed, but here it is. Any ideas how to fix it? Happy to share more details or code snippets!
The text was updated successfully, but these errors were encountered: