-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Puma >= 6.1.0 + Rails 7 produce empty rack.input in custom middleware #3145
Comments
Hi @sanzstez I can help look into this. The first step for me will be to reproduce locally. Is this something you can help with? Maybe we can setup a simple test app based on https://github.com/puma/puma/tree/master/benchmarks/local/sinatra Any help you can provide helping me reproduce locally would be appreciated. Once I can do that, I should be able to take it from there. |
@willkoehler Thank you for response. Really appreciate! |
@sanzstez agreed, the Sinatra app might not work because of the Middleware. We could use a simple Rails app perhaps? |
PR #3137 added some tests that would seem to cover this issue, but it's only in the master branch. The issue fixed by the PR involved some encoding issues with uploads. They used curl as a client, similar to the below:
Might this be related? If so, can you check this against Puma master? |
Thanks @MSP-Greg that certainly looks promising! BTW I originally had |
@MSP-Greg @willkoehler I don't know why ... but it works from master! Checked few minutes ago. Can you please explain what happened? (for understand). UPD: Checked master sources and comments above. Understood. Very interesting story with rubocop and String.new vs +"", really. |
Great, #3137 should be part of the next release. I'll close this. |
I am using custom middleware for parsing multipart/related body content. Request sending with
Transfer-Encoding: chunked
.Everything works fine with version of puma <= 6.0.2.
But after upgrade puma to 6.1.0 rails become generate Bad request content body in output. And as I see with debug env['rack.input'] contain empty string.
UPD:
During my research I found that functionality was broken by this PR: #3062
by adding
instead of
Puma config:
Default rails DEVELOPMENT config.
To Reproduce
Simplified middleware what I am using:
Middleware was included to rails app as usually:
Ruby version: 3.1.2
Rails version: 7.0.4.3
Rack version: 2.2.7
Puma version: >= 6.1.0
The text was updated successfully, but these errors were encountered: