From 751d3df4691b045df994cbc63a950962de6b5768 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 19 Feb 2016 10:56:43 +0100 Subject: [PATCH] Only add checksum headers for files We can only add the checksum header for real ownCloud files (so we have a fileinfo object etc). --- apps/dav/lib/connector/sabre/filesplugin.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php index 2e913ee1077..eb9116d219b 100644 --- a/apps/dav/lib/connector/sabre/filesplugin.php +++ b/apps/dav/lib/connector/sabre/filesplugin.php @@ -193,11 +193,13 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { // adds a 'Content-Disposition: attachment' header $response->addHeader('Content-Disposition', 'attachment'); - //Add OC-Checksum header - /** @var $node File */ - $checksum = $node->getChecksum(); - if ($checksum !== null) { - $response->addHeader('OC-Checksum', $checksum); + if ($node instanceof \OCA\DAV\Connector\Sabre\File) { + //Add OC-Checksum header + /** @var $node File */ + $checksum = $node->getChecksum(); + if ($checksum !== null) { + $response->addHeader('OC-Checksum', $checksum); + } } } -- 2.39.5