diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-03-19 17:25:40 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-04-02 14:16:13 +0200 |
commit | 516fb702c98609ee6c036123477470a6e566db4e (patch) | |
tree | 5da28659ac0a440ec944d94c3369edb2c3dfe95f /apps/dav/lib/Connector/Sabre/QuotaPlugin.php | |
parent | 6c3a1a360abd9b8216152ae7597bd3b09ddce628 (diff) | |
download | nextcloud-server-516fb702c98609ee6c036123477470a6e566db4e.tar.gz nextcloud-server-516fb702c98609ee6c036123477470a6e566db4e.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/QuotaPlugin.php')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/QuotaPlugin.php | 10 |
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); } /** |