]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only add checksum headers for files
authorRoeland Jago Douma <rullzer@owncloud.com>
Fri, 19 Feb 2016 09:56:43 +0000 (10:56 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Fri, 19 Feb 2016 09:56:43 +0000 (10:56 +0100)
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

index 2e913ee1077b089113b17b9890049dad5b5a752c..eb9116d219b9ae98632f3614969f5374ab8b4f7a 100644 (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);
+                       }
                }
        }