diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/server.php | 17 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/filesreportplugin.php | 22 |
2 files changed, 11 insertions, 28 deletions
diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php index 74be318fe5e..55ae6c62d31 100644 --- a/apps/dav/lib/server.php +++ b/apps/dav/lib/server.php @@ -31,10 +31,6 @@ use OCA\DAV\Files\CustomPropertiesBackend; use OCP\IRequest; use OCP\SabrePluginEvent; use Sabre\DAV\Auth\Plugin; -use Sabre\DAV\IFile; -use Sabre\HTTP\RequestInterface; -use Sabre\HTTP\ResponseInterface; -use Sabre\HTTP\Util; class Server { @@ -114,19 +110,6 @@ class Server { $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\FakeLockerPlugin()); } - // Serve all files with an Content-Disposition of type "attachment" - $this->server->on('beforeMethod', function (RequestInterface $requestInterface, ResponseInterface $responseInterface) { - if ($requestInterface->getMethod() === 'GET') { - $path = $requestInterface->getPath(); - if ($this->server->tree->nodeExists($path)) { - $node = $this->server->tree->getNodeForPath($path); - if (($node instanceof IFile)) { - $responseInterface->addHeader('Content-Disposition', 'attachment'); - } - } - } - }); - // wait with registering these until auth is handled and the filesystem is setup $this->server->on('beforeMethod', function () { // custom properties plugin must be the last one diff --git a/apps/dav/tests/unit/connector/sabre/filesreportplugin.php b/apps/dav/tests/unit/connector/sabre/filesreportplugin.php index 83af45d3bcd..78f9e77063c 100644 --- a/apps/dav/tests/unit/connector/sabre/filesreportplugin.php +++ b/apps/dav/tests/unit/connector/sabre/filesreportplugin.php @@ -19,7 +19,7 @@ * */ -namespace OCA\DAV\Tests\Unit\Sabre\Connector; +namespace OCA\DAV\Tests\Unit\Connector\Sabre; use OCA\DAV\Connector\Sabre\FilesReportPlugin as FilesReportPluginImplementation; use Sabre\DAV\Exception\NotFound; @@ -369,7 +369,7 @@ class FilesReportPlugin extends \Test\TestCase { ['123', 'files'] ) ->willReturnMap([ - ['123', 'files', ['111', '222']], + ['123', 'files', 0, '', ['111', '222']], ]); $rules = [ @@ -391,8 +391,8 @@ class FilesReportPlugin extends \Test\TestCase { ['456', 'files'] ) ->willReturnMap([ - ['123', 'files', ['111', '222']], - ['456', 'files', ['222', '333']], + ['123', 'files', 0, '', ['111', '222']], + ['456', 'files', 0, '', ['222', '333']], ]); $rules = [ @@ -415,8 +415,8 @@ class FilesReportPlugin extends \Test\TestCase { ['456', 'files'] ) ->willReturnMap([ - ['123', 'files', ['111', '222']], - ['456', 'files', []], + ['123', 'files', 0, '', ['111', '222']], + ['456', 'files', 0, '', []], ]); $rules = [ @@ -439,8 +439,8 @@ class FilesReportPlugin extends \Test\TestCase { ['456', 'files'] ) ->willReturnMap([ - ['123', 'files', []], - ['456', 'files', ['111', '222']], + ['123', 'files', 0, '', []], + ['456', 'files', 0, '', ['111', '222']], ]); $rules = [ @@ -464,9 +464,9 @@ class FilesReportPlugin extends \Test\TestCase { ['789', 'files'] ) ->willReturnMap([ - ['123', 'files', ['111', '222']], - ['456', 'files', ['333']], - ['789', 'files', ['111', '222']], + ['123', 'files', 0, '', ['111', '222']], + ['456', 'files', 0, '', ['333']], + ['789', 'files', 0, '', ['111', '222']], ]); $rules = [ |