]> source.dussan.org Git - nextcloud-server.git/commitdiff
Buffer chunked requests 43047/head
authorLouis Chemineau <louis@chmn.me>
Tue, 23 Jan 2024 10:01:58 +0000 (11:01 +0100)
committerLouis Chemineau <louis@chmn.me>
Wed, 24 Jan 2024 11:11:37 +0000 (12:11 +0100)
Signed-off-by: Louis Chemineau <louis@chmn.me>
.htaccess

index ece21e1450d3243b6364110f5054fd00d5771c9d..102b11236be8281b0143ea58f163fa566efd6deb 100644 (file)
--- a/.htaccess
+++ b/.htaccess
   RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
 </IfModule>
 
+# 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
+<IfModule setenvif.c>
+  <Location "/remote.php">
+    SetEnvIf Transfer-Encoding "chunked" proxy-sendcl=1
+  </Location>
+</IfModule>
+
 AddDefaultCharset utf-8
 Options -Indexes