Merge pull request #14517 from nextcloud/backport/13871/stable15

[stable15] dav: Fix handling of chunked WebDAV upload
This commit is contained in:
Morris Jobke 2019-03-05 10:05:25 +01:00 committed by GitHub
commit 6e5a93026c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,7 +208,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: