Skip to content
Snippets Groups Projects
Commit 36c88e28 authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #10422 from owncloud/dav-disablerangerequestwhennotsupported

Return whole file if range request cannot be granted due to encryption
parents 375a8535 cc8c1d8e
No related branches found
No related tags found
No related merge requests found
......@@ -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
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment