diff options
author | Robin Appelman <robin@icewind.nl> | 2018-06-28 14:53:44 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-06-28 14:54:46 +0200 |
commit | b21bec5c738da812ef2df744416feaa33ce6a328 (patch) | |
tree | 957bc5c1e975037cf8655811251636034721d53a /apps/dav/lib/Server.php | |
parent | 388ea2234f96be1fc774d4dc02b71e7d67d31910 (diff) | |
download | nextcloud-server-b21bec5c738da812ef2df744416feaa33ce6a328.tar.gz nextcloud-server-b21bec5c738da812ef2df744416feaa33ce6a328.zip |
Fix search related results in OPTIONS requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Server.php')
-rw-r--r-- | apps/dav/lib/Server.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index a401fb57045..25a5b95f372 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -53,6 +53,7 @@ use OCA\DAV\DAV\CustomPropertiesBackend; use OCA\DAV\Connector\Sabre\QuotaPlugin; use OCA\DAV\Files\BrowserErrorPagePlugin; use OCA\DAV\Connector\Sabre\AnonymousOptionsPlugin; +use OCA\DAV\Files\LazySearchBackend; use OCA\DAV\SystemTag\SystemTagPlugin; use OCA\DAV\Upload\ChunkingPlugin; use OCP\IRequest; @@ -195,8 +196,11 @@ class Server { $this->server->addPlugin(new BrowserErrorPagePlugin()); } + $lazySearchBackend = new LazySearchBackend(); + $this->server->addPlugin(new SearchPlugin($lazySearchBackend)); + // wait with registering these until auth is handled and the filesystem is setup - $this->server->on('beforeMethod', function () use ($root) { + $this->server->on('beforeMethod', function () use ($root, $lazySearchBackend) { // custom properties plugin must be the last one $userSession = \OC::$server->getUserSession(); $user = $userSession->getUser(); @@ -255,13 +259,13 @@ class Server { \OC::$server->getGroupManager(), $userFolder )); - $this->server->addPlugin(new SearchPlugin(new \OCA\DAV\Files\FileSearchBackend( + $lazySearchBackend->setBackend(new \OCA\DAV\Files\FileSearchBackend( $this->server->tree, $user, \OC::$server->getRootFolder(), \OC::$server->getShareManager(), $view - ))); + )); } $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin( \OC::$server->getConfig(), |