aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/publicwebdav.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-05-14 23:08:45 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-06-14 10:13:24 +0200
commitc6a83b2f1740936ba39acc13b6f0f9b9d619ca07 (patch)
tree731bb148506b729916c0eac0b4fa2326f93ff42e /apps/files_sharing/publicwebdav.php
parentcf5a72c10398bb18817cff8ca4dfba4429a97123 (diff)
downloadnextcloud-server-c6a83b2f1740936ba39acc13b6f0f9b9d619ca07.tar.gz
nextcloud-server-c6a83b2f1740936ba39acc13b6f0f9b9d619ca07.zip
Fix exposing single files over webdav
Diffstat (limited to 'apps/files_sharing/publicwebdav.php')
-rw-r--r--apps/files_sharing/publicwebdav.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php
index df2c04cf45c..b4f56eed89c 100644
--- a/apps/files_sharing/publicwebdav.php
+++ b/apps/files_sharing/publicwebdav.php
@@ -47,8 +47,12 @@ $server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $
$rootInfo = $view->getFileInfo('');
// Create ownCloud Dir
- $rootDir = new OC_Connector_Sabre_Directory($view, $rootInfo);
- $objectTree->init($rootDir, $view);
+ if ($rootInfo->getType() === 'dir') {
+ $root = new OC_Connector_Sabre_Directory($view, $rootInfo);
+ } else {
+ $root = new OC_Connector_Sabre_File($view, $rootInfo);
+ }
+ $objectTree->init($root, $view);
$server->addPlugin(new OC_Connector_Sabre_AbortedUploadDetectionPlugin($view));
$server->addPlugin(new OC_Connector_Sabre_QuotaPlugin($view));