summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-08-29 19:56:50 +0200
committerGitHub <noreply@github.com>2016-08-29 19:56:50 +0200
commit613704c58e4f9b80716df569248b381300540c98 (patch)
tree7b0e0f489d8aa19a50676f0812351a5fcf742219
parent7c7f862712d010123baa1a02b5e0978df9819f7d (diff)
parent0cb34c2fa52de9f71f7bca036c01e94ab6220459 (diff)
downloadnextcloud-server-613704c58e4f9b80716df569248b381300540c98.tar.gz
nextcloud-server-613704c58e4f9b80716df569248b381300540c98.zip
Merge pull request #1145 from nextcloud/upstream-25794
DAV: Return data-fingerprint always when asked
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php9
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php6
2 files changed, 6 insertions, 9 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index c472f75b6bf..dd5f958ed4c 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -324,18 +324,13 @@ class FilesPlugin extends ServerPlugin {
return $displayName;
});
- $propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function() use ($node) {
- if ($node->getPath() === '/') {
- return $this->config->getSystemValue('data-fingerprint', '');
- }
- });
-
$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
return json_encode($this->previewManager->isAvailable($node->getFileInfo()));
});
}
- if ($node instanceof \OCA\DAV\Files\FilesHome) {
+ if ($node instanceof \OCA\DAV\Connector\Sabre\Node
+ || $node instanceof \OCA\DAV\Files\FilesHome) {
$propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function() use ($node) {
return $this->config->getSystemValue('data-fingerprint', '');
});
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index 6630c027541..e2d63868af0 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -213,7 +213,8 @@ class FilesPluginTest extends TestCase {
$this->assertEquals('http://example.com/', $propFind->get(self::DOWNLOADURL_PROPERTYNAME));
$this->assertEquals('foo', $propFind->get(self::OWNER_ID_PROPERTYNAME));
$this->assertEquals('M. Foo', $propFind->get(self::OWNER_DISPLAY_NAME_PROPERTYNAME));
- $this->assertEquals([self::SIZE_PROPERTYNAME, self::DATA_FINGERPRINT_PROPERTYNAME], $propFind->get404Properties());
+ $this->assertEquals('my_fingerprint', $propFind->get(self::DATA_FINGERPRINT_PROPERTYNAME));
+ $this->assertEquals([self::SIZE_PROPERTYNAME], $propFind->get404Properties());
}
public function testGetPropertiesForFileHome() {
@@ -357,7 +358,8 @@ class FilesPluginTest extends TestCase {
$this->assertEquals(1025, $propFind->get(self::SIZE_PROPERTYNAME));
$this->assertEquals('DWCKMSR', $propFind->get(self::PERMISSIONS_PROPERTYNAME));
$this->assertEquals(null, $propFind->get(self::DOWNLOADURL_PROPERTYNAME));
- $this->assertEquals([self::DOWNLOADURL_PROPERTYNAME, self::DATA_FINGERPRINT_PROPERTYNAME], $propFind->get404Properties());
+ $this->assertEquals('my_fingerprint', $propFind->get(self::DATA_FINGERPRINT_PROPERTYNAME));
+ $this->assertEquals([self::DOWNLOADURL_PROPERTYNAME], $propFind->get404Properties());
}
public function testGetPropertiesForRootDirectory() {