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
raw_post being empty for "Transfer-Encoding: chunked" #46784
Comments
Hey @kazu9su, thanks for reporting this issue. I'm going to take a look at this some time this week, apologies its taken a while to get around to it! |
@kazu9su a fix was merged upstream, any chance you could retest? |
@hahmed First of all, thank you for letting me know it and thank you all to work on this issue! I tested this version of rails 097ead2 with unicorn 6.1.0 app, and found out all things work well except for 'CONTENT_LENGTH' value of With Puma 5.6.5 app, I can get correct CONTENT_LENGTH value from request.headers hash like this but it showed as nil on unicorn 6.1.0 app. I suppose that it would solve this problem that setting CONTENT_LENGTH at the same time. How do you think? |
@hahmed Again, thank you for the great work! |
raw_post
of chunked request is empty. I would like to open a feature request to handle chunked request by action pack.I found the same issue was raised by @hahmed and he sent the PR to fix it but was closed at that time.
The reason why the PR closed is the problem was solved with Puma by adding CONTENT_LENGTH request header at the Puma layer by this PR.
However, the same problem still happens with unicorn, thin and webrick at least.
It is helpful to us application developers if this problem would be taken care by rails so that we won't have to check neither the request is chunked nor which rack http server is used.
Steps to reproduce
I prepared environments to reproduce the problem via docker. Please download it and follow the instruction of README.
https://github.com/kazu9su/rails-experiment
Expected behavior
If the chunked request is sent to the rails server, application can read the
raw_post
with any rack http server.Actual behavior
We can access to the request body with
raw_post
with only the rack http server which buffers the request body upfront like Puma.The text was updated successfully, but these errors were encountered: