summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJan-Philipp Litza <jplitza@users.noreply.github.com>2019-01-28 17:11:14 +0100
committerJan-Philipp Litza <jpl@plutex.de>2019-01-28 17:14:22 +0100
commit9348e3d2f693b4f278fb2eb13c225f7ea2bbb9bb (patch)
tree822143fc580d0797e9f118a905523b8e5a11fd14 /apps
parentcfdece7833ed407cfee63b73c9ae20fde848ffc3 (diff)
downloadnextcloud-server-9348e3d2f693b4f278fb2eb13c225f7ea2bbb9bb.tar.gz
nextcloud-server-9348e3d2f693b4f278fb2eb13c225f7ea2bbb9bb.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...
Diffstat (limited to 'apps')
-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 f948f0f552d..111b1925108 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -188,7 +188,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: