Skip to content

Commit

Permalink
Load apps dav plugins on the old webdav route
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Nov 21, 2019
1 parent 5c4b2a2 commit 846f0f9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/dav/lib/Connector/Sabre/ServerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
namespace OCA\DAV\Connector\Sabre;

use OC\Files\Node\Folder;
use OCA\DAV\AppInfo\PluginManager;
use OCA\DAV\Files\BrowserErrorPagePlugin;
use OCP\Files\Mount\IMountManager;
use OCP\IConfig;
Expand All @@ -39,6 +40,7 @@
use OCP\IRequest;
use OCP\ITagManager;
use OCP\IUserSession;
use OCP\SabrePluginEvent;
use Sabre\DAV\Auth\Plugin;

class ServerFactory {
Expand Down Expand Up @@ -195,6 +197,18 @@ public function createServer($baseUri,
);
}
$server->addPlugin(new \OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin());

// Load dav plugins from apps
$event = new SabrePluginEvent($server);
\OC::$server->getEventDispatcher()->dispatch($event);
$pluginManager = new PluginManager(
\OC::$server,
\OC::$server->getAppManager()
);
foreach ($pluginManager->getAppPlugins() as $appPlugin) {
$server->addPlugin($appPlugin);
}

}, 30); // priority 30: after auth (10) and acl(20), before lock(50) and handling the request
return $server;
}
Expand Down

0 comments on commit 846f0f9

Please sign in to comment.