nextcloud/apps/settings/lib
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
..
Activity chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
AppInfo feat: add setup check for request buffering on FPM 2025-09-05 01:06:13 +02:00
BackgroundJobs fix(lookup-server): disable lookup server for non-global scale setups 2025-03-11 14:26:47 +01:00
Command/AdminDelegation chore(deps): Update nextcloud/coding-standard to v1.3.1 2024-09-19 14:21:20 +02:00
Controller feat: add setup check for request buffering on FPM 2025-09-05 01:06:13 +02:00
Events chore: Add SPDX header 2024-06-03 20:33:31 +02:00
Listener chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Mailer chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Middleware chore(i18n): Aligned grammar 2025-03-31 16:58:07 +02:00
Search chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Sections feat(Settings): Add section to select preset 2025-08-27 14:20:58 +00:00
Service chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Settings feat(Settings): Add section to select preset 2025-08-27 14:20:58 +00:00
SetupChecks feat: add setup check for request buffering on FPM 2025-09-05 01:06:13 +02:00
UserMigration refactor: Extend rector to core/ 2025-05-15 00:16:54 +02:00
WellKnown fix(security): Update Expires time 2025-09-04 08:56:48 +02:00
Hooks.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
ResponseDefinitions.php feat: add support for sensitive Declarative settings values encryption 2025-05-28 20:43:04 +03:00