Merge pull request #15150 from owncloud/sabre-removerangeexceptionforencryption

Remove range header exception for encryption
This commit is contained in:
Vincent Petry 2015-03-24 14:29:01 +01:00
commit 331f0196e0
1 changed files with 0 additions and 14 deletions

View File

@ -70,7 +70,6 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
$this->server->on('propPatch', array($this, 'handleUpdateProperties')); $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
$this->server->on('afterBind', array($this, 'sendFileIdHeader')); $this->server->on('afterBind', array($this, 'sendFileIdHeader'));
$this->server->on('afterWriteContent', array($this, 'sendFileIdHeader')); $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader'));
$this->server->on('beforeMethod:GET', array($this, 'handleRangeHeaders'));
} }
/** /**
@ -178,17 +177,4 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
} }
} }
/**
* Remove range headers if encryption is enabled.
*
* @param RequestInterface $request
* @param ResponseInterface $response
*/
public function handleRangeHeaders(RequestInterface $request, ResponseInterface $response) {
if (\OC_App::isEnabled('files_encryption')) {
// encryption does not support range requests (yet)
$request->removeHeader('range');
}
}
} }