Skip to content

Commit 5d4546c

Browse files
committed
Buffer chunked requests
Signed-off-by: Louis Chemineau <[email protected]>
1 parent b0c003d commit 5d4546c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.htaccess

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,19 @@
9494
RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
9595
</IfModule>
9696

97+
# Clients like xDavv5 on Android, or Cyberduck, use chunked requests.
98+
# When FastCGI or FPM is used with apache, requests arrive to Nextcloud without any content.
99+
# This leads to the creation of empty files.
100+
# The following directive will force the problematic requests to be buffered before being forwarded to Nextcloud.
101+
# This way, the "Transfer-Encoding" header is removed, the "Content-Length" header is set, and the request content is proxied to Nextcloud.
102+
# Here are more information about the issue:
103+
# - https://docs.cyberduck.io/mountainduck/issues/fastcgi/
104+
# - https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav
105+
<IfModule setenvif.c>
106+
<Location "/remote.php">
107+
SetEnvIf Transfer-Encoding "chunked" proxy-sendcl=1
108+
</Location>
109+
</IfModule>
110+
97111
AddDefaultCharset utf-8
98112
Options -Indexes

0 commit comments

Comments
 (0)