summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre/directory.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-02-11 10:31:01 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-02-11 10:31:01 +0100
commit99f41de7de4e96f5d490cfc8f3b962171d201587 (patch)
tree4c785f7f83d9f1ebc74282042bd07f5f52bb644b /lib/connector/sabre/directory.php
parent2cb2991c049387290d6ba71a08381aeac4de2fe3 (diff)
downloadnextcloud-server-99f41de7de4e96f5d490cfc8f3b962171d201587.tar.gz
nextcloud-server-99f41de7de4e96f5d490cfc8f3b962171d201587.zip
only check content lenght on PUT to make litmus happy
Diffstat (limited to 'lib/connector/sabre/directory.php')
-rw-r--r--lib/connector/sabre/directory.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index f9245115353..e29059d0395 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -69,13 +69,15 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
\OC\Files\Filesystem::file_put_contents($partpath, $data);
//detect aborted upload
- if (isset($_SERVER['CONTENT_LENGTH'])) {
- $expected = $_SERVER['CONTENT_LENGTH'];
- $actual = \OC\Files\Filesystem::filesize($partpath);
- if ($actual != $expected) {
- \OC\Files\Filesystem::unlink($partpath);
- throw new Sabre_DAV_Exception_BadRequest(
- 'expected filesize ' . $expected . ' got ' . $actual);
+ if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) {
+ if (isset($_SERVER['CONTENT_LENGTH'])) {
+ $expected = $_SERVER['CONTENT_LENGTH'];
+ $actual = \OC\Files\Filesystem::filesize($partpath);
+ if ($actual != $expected) {
+ \OC\Files\Filesystem::unlink($partpath);
+ throw new Sabre_DAV_Exception_BadRequest(
+ 'expected filesize ' . $expected . ' got ' . $actual);
+ }
}
}