diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-24 12:15:32 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-24 12:15:32 +0100 |
commit | 473cd97a45dd1343cec14abfcc60b14b9c12f7e4 (patch) | |
tree | 4bc60fe3149d7060105489fb27cfe2dbb1f7bdb6 /apps | |
parent | 2ec1c738d0b2570f3f52dcd790aec0018e59e856 (diff) | |
parent | 403f11633c50b087fee8ffc7ce0dd9ac3e5f1263 (diff) | |
download | nextcloud-server-473cd97a45dd1343cec14abfcc60b14b9c12f7e4.tar.gz nextcloud-server-473cd97a45dd1343cec14abfcc60b14b9c12f7e4.zip |
Merge pull request #22592 from owncloud/fix-response-header
Add header for attachment disposition only once
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/server.php | 17 |
1 files changed, 0 insertions, 17 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 |