mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
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:
parent
ae2304f23f
commit
751d3df469
1 changed files with 7 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue