summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Connector/Sabre
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-04 12:50:31 +0000
commita007651d202aada80d865017e12f676f8ed9c88d (patch)
tree65374bd495bed371fe0847546868195689f0fa5d /apps/dav/lib/Connector/Sabre
parentadea4af91e3574367200a8cdb827e41e8175fba7 (diff)
downloadnextcloud-server-a007651d202aada80d865017e12f676f8ed9c88d.tar.gz
nextcloud-server-a007651d202aada80d865017e12f676f8ed9c88d.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/lib/Connector/Sabre')
-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 ddf4b2773e0..1b69ddaf5de 100644
--- a/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/QuotaPlugin.php
@@ -227,11 +227,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);
}
/**