From 206bba9d27797b27da8ee61625a59a81366bc1a5 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Tue, 23 Jan 2024 11:01:58 +0100 Subject: [PATCH] Buffer chunked requests Signed-off-by: Louis Chemineau --- .htaccess | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.htaccess b/.htaccess index 58d1b3c420d..dcc13e5e3bc 100644 --- a/.htaccess +++ b/.htaccess @@ -103,5 +103,19 @@ RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L] +# Clients like xDavv5 on Android, or Cyberduck, use chunked requests. +# When FastCGI or FPM is used with apache, requests arrive to Nextcloud without any content. +# This leads to the creation of empty files. +# The following directive will force the problematic requests to be buffered before being forwarded to Nextcloud. +# This way, the "Transfer-Encoding" header is removed, the "Content-Length" header is set, and the request content is proxied to Nextcloud. +# Here are more information about the issue: +# - https://docs.cyberduck.io/mountainduck/issues/fastcgi/ +# - https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav + + + SetEnvIf Transfer-Encoding "chunked" proxy-sendcl=1 + + + AddDefaultCharset utf-8 Options -Indexes