Only add checksum headers for files

We can only add the checksum header for real ownCloud files (so we have
a fileinfo object etc).
This commit is contained in:
Roeland Jago Douma 2016-02-19 10:56:43 +01:00
parent ae2304f23f
commit 751d3df469

View file

@ -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);
}
}
}