diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-08-20 18:14:09 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-08-20 18:14:09 +0200 |
commit | 36c88e28307da569fea7a86d18ad559aa0b3f868 (patch) | |
tree | fabc731e330b578094cb5f17db9b571434ffd37e | |
parent | 375a8535c4db7e0117bbb688b97edd2ebc98cecc (diff) | |
parent | cc8c1d8e0776bda7f4c7c28e11984144a4861df3 (diff) | |
download | nextcloud-server-36c88e28307da569fea7a86d18ad559aa0b3f868.tar.gz nextcloud-server-36c88e28307da569fea7a86d18ad559aa0b3f868.zip |
Merge pull request #10422 from owncloud/dav-disablerangerequestwhennotsupported
Return whole file if range request cannot be granted due to encryption
-rw-r--r-- | lib/private/connector/sabre/server.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/server.php b/lib/private/connector/sabre/server.php index aaf4fe85af9..43c3464f1ca 100644 --- a/lib/private/connector/sabre/server.php +++ b/lib/private/connector/sabre/server.php @@ -33,6 +33,11 @@ class OC_Connector_Sabre_Server extends Sabre\DAV\Server { */ private $overLoadedUri = null; + /** + * @var boolean + */ + private $ignoreRangeHeader = false; + public function getRequestUri() { if (!is_null($this->overLoadedUri)) { @@ -59,6 +64,23 @@ class OC_Connector_Sabre_Server extends Sabre\DAV\Server { return $result; } + public function getHTTPRange() { + if ($this->ignoreRangeHeader) { + return null; + } + return parent::getHTTPRange(); + } + + protected function httpGet($uri) { + $range = $this->getHTTPRange(); + + if (OC_App::isEnabled('files_encryption') && $range) { + // encryption does not support range requests + $this->ignoreRangeHeader = true; + } + return parent::httpGet($uri); + } + /** * @see \Sabre\DAV\Server */ |