nextcloud/apps/settings/composer
Ferdinand Thiessen ccc4d2eb9f
feat: add setup check for request buffering on FPM
Context: Using `Transfer-Encoding: chunked` of HTTP 1.1

PHP-FPM has a bug[1] where the request body is not passed to PHP
if the `Content-Length` header is missing, while FastCGI in general
allows this (I could reproduce that FastCGI passed the request stream
from NGinx) PHP-FPM does not forward this to the PHP application.

This means when using PHP-FPM we get an empty request body and thus
every `PUT` will be an empty file.

I tested that `mod_php` is not affected, while it also has no
`Content-Length` header, it correctly passed the stream and thus also
works without buffering the request.

Only PHP-FPM needs buffering of the request so that a `Content-Length`
header can be generated.

To enable this on Apache set: `SetEnvIfNoCase Transfer-Encoding "chunked" proxy-sendcl=1`
On NGinx: `fastcgi_request_buffering on;`.

[1]: https://github.com/php/php-src/issues/9441
ref: https://github.com/nextcloud/server/issues/7995

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-05 01:06:13 +02:00
..
composer feat: add setup check for request buffering on FPM 2025-09-05 01:06:13 +02:00
autoload.php Add .well-known/changepassword handler 2022-10-22 13:23:59 +02:00
composer.json Move settings to an app 2019-09-28 09:39:28 +00:00
composer.lock Add missing files for Composer v2 2021-08-13 15:01:02 +02:00