-
-
Notifications
You must be signed in to change notification settings - Fork 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
Transfer-Encoding: chunked causing php_fastcgi to hang #5236
Comments
This is a good bug report, thanks for the investigation and the details. I'm a little behind on things currently, but anyone is welcome to look into this for faster resolution! |
@arabcoders @mholt My dirty hack seems to work fine in this scenario.
|
Sounds good @u5surf, PR is welcome! If you open a PR, it would probably make it easier for @arabcoders to test and confirm the fix. |
@u5surf Thank you for for your patch. Indeed it would be great if you can send PR so i can test it out, sadly i don't have the infra to build caddy at the moment. |
It doesn't really take any "infrastructure", you just install Go (download a tar/zip, extract it to your PATH) and then download |
Thanks, i tried to patch caddy but it keep failing with this error
im tying to manually add the changes and will see how it goes. Edit: nevermind, ignoring whitespace did the trick Edit2: Build somewhat works, however it seems there is slight problem not sure if it's a problem or not checking the headers caddy sending to fastcgi server it seems
However, the server does response correctly now
|
* Fixes caddyserver#5236 * enable request body buffering in reverse proxy when the request header has Transfer-Encoding: chunked
I find that it should add the content-length header after |
* Fixes caddyserver#5236 * enable request body buffering in reverse proxy when the request header has Transfer-Encoding: chunked
Added |
@u5surf Thank you it seems the Content-Length is populated now, although it seems there is an extra header as well
It seems the fix did indeed fix |
That's normal --
|
Thanks good to know, it seems indeed this PR fixes the issues Thanks to @u5surf |
* Fixes #5236 * enable request body buffering in reverse proxy when the request header has Transfer-Encoding: chunked
Thanks, i really didn't face this problem in nginx or apache back when i used them, i assume they don't buffer larger requests to memory rather to tmp file and then pass that to fastcgi |
Hello, I was attempting to support
Transfer-Encoding: chunked
header into my application, and noticed that the server never responses if the header is used.Caddyfile
php file (index.php)
Example of working request/response
Caddy Logs
Example of not working request/response
Caddy logs.
i also tried with
buffer_requests
andflush_interval -1
and it seems to have no effect.This behavior led me to believe it was an issue with PHP itself, however digging deeper i was able to find this issue php bug #60826, reading the replies this suggest the problem is not conforming to fastcgi spec
In a strict sense this is indeed not a PHP bug, because the CGI specification (which is only informational, though), mandates[1]:
It seems apache also had the bug and they have somewhat working fix at https://bz.apache.org/bugzilla/show_bug.cgi?id=57087
I tried to see if the request itself is valid i used python gunicorn to test
The text was updated successfully, but these errors were encountered: