summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-08-08 00:42:28 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-08-08 00:42:28 +0200
commitfb890eee674fece6194a743483ae59f4384c7eb4 (patch)
treef828f390c9a96ef201a5d49b70aca86526845d89 /lib/connector/sabre
parent0deae7b86fbbcb8aaf4ada73950fd5a9b56f719f (diff)
downloadnextcloud-server-fb890eee674fece6194a743483ae59f4384c7eb4.tar.gz
nextcloud-server-fb890eee674fece6194a743483ae59f4384c7eb4.zip
fixes #4343
Diffstat (limited to 'lib/connector/sabre')
-rw-r--r--lib/connector/sabre/quotaplugin.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/connector/sabre/quotaplugin.php b/lib/connector/sabre/quotaplugin.php
index c80a33d04b1..0f428b75b19 100644
--- a/lib/connector/sabre/quotaplugin.php
+++ b/lib/connector/sabre/quotaplugin.php
@@ -43,8 +43,7 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin {
* @return bool
*/
public function checkQuota($uri, $data = null) {
- $expected = $this->server->httpRequest->getHeader('X-Expected-Entity-Length');
- $length = $expected ? $expected : $this->server->httpRequest->getHeader('Content-Length');
+ $length = $this->getLength();
if ($length) {
if (substr($uri, 0, 1)!=='/') {
$uri='/'.$uri;
@@ -57,4 +56,19 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin {
}
return true;
}
+
+ private function getLength()
+ {
+ $expected = $this->server->httpRequest->getHeader('X-Expected-Entity-Length');
+ if ($expected)
+ return $expected;
+
+ $length = $this->server->httpRequest->getHeader('Content-Length');
+ $ocLength = $this->server->httpRequest->getHeader('OC-Total-Length');
+
+ if ($length && $ocLength)
+ return max($length, $ocLength);
+
+ return $length;
+ }
}