diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-12-14 17:35:27 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-12-14 17:35:27 +0100 |
commit | 8a00638425de4016cd86b5e1b9e0b3ac193eb7e6 (patch) | |
tree | c3059705b8a6dc67d5654cc2e6287056532f839f /apps | |
parent | e1b806467c19f85af975fcbc9793a730614c2963 (diff) | |
download | nextcloud-server-8a00638425de4016cd86b5e1b9e0b3ac193eb7e6.tar.gz nextcloud-server-8a00638425de4016cd86b5e1b9e0b3ac193eb7e6.zip |
Don't set Content-Disposition header if one already exists
If a Content-Disposition header is already set by another plugin we don't need to set another one as this breaks clients.
Fixes https://github.com/nextcloud/server/issues/1992
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 59b326243ee..54d91db5c06 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -247,8 +247,10 @@ class FilesPlugin extends ServerPlugin { $node = $this->tree->getNodeForPath($request->getPath()); if (!($node instanceof IFile)) return; - // adds a 'Content-Disposition: attachment' header - if ($this->downloadAttachment) { + // adds a 'Content-Disposition: attachment' header in case no disposition + // header has been set before + if ($this->downloadAttachment && + $response->getHeader('Content-Disposition') === null) { $filename = $node->getName(); if ($this->request->isUserAgent( [ |