aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-03-19 17:25:40 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-04-02 15:45:57 +0000
commitae7105b99020429bec76b289d656d2c2c1e402cb (patch)
tree630580d8358ff017c0b4bea906bf49ab0424f7e2 /apps/dav
parent991ee6fbb81b4b3bed76aa26be0e0e2b1056558e (diff)
downloadnextcloud-server-ae7105b99020429bec76b289d656d2c2c1e402cb.tar.gz
nextcloud-server-ae7105b99020429bec76b289d656d2c2c1e402cb.zip
fix(dav): Fix quota check for chunk upload
Do not ignore OC-Total-Length when Content-Length and X-Expected-Entity-Length are missing Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Connector/Sabre/QuotaPlugin.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
index 687b05e86cb..b37325430e7 100644
--- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
@@ -250,11 +250,13 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
}
$ocLength = $req->getHeader('OC-Total-Length');
- if (is_numeric($length) && is_numeric($ocLength)) {
- return max($length, $ocLength);
+ if (!is_numeric($ocLength)) {
+ return $length;
}
-
- return $length;
+ if (!is_numeric($length)) {
+ return $ocLength;
+ }
+ return max($length, $ocLength);
}
/**