summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Philipp Litza <jplitza@users.noreply.github.com>2019-01-28 17:11:14 +0100
committerBackportbot <backportbot-noreply@rullzer.com>2019-03-04 16:44:21 +0000
commit6c5c01974f68c047c4688ba1ee4be8ca0fe5d911 (patch)
treecd569b98e55597f07f5393d1a140ffce16cea991
parentaf15979eb90e0e8d5501c063ea230cd8bfc82052 (diff)
downloadnextcloud-server-6c5c01974f68c047c4688ba1ee4be8ca0fe5d911.tar.gz
nextcloud-server-6c5c01974f68c047c4688ba1ee4be8ca0fe5d911.zip
dav: Fix handling of chunked WebDAV upload
When $data is null (which can happen when $request->getBodyAsStream() returns null), the Exceptions says "copied bytes: 0, expected filesize: 0", which sounds more like success...
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index 8aa7d66ba34..fe301d93729 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -205,7 +205,9 @@ class File extends Node implements IFile {
if (isset($_SERVER['CONTENT_LENGTH'])) {
$expected = $_SERVER['CONTENT_LENGTH'];
}
- throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )');
+ if ($expected !== "0") {
+ throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )');
+ }
}
// if content length is sent by client: