only check content lenght on PUT to make litmus happy
This commit is contained in:
parent
2cb2991c04
commit
99f41de7de
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,13 +51,15 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
|
|||
\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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue