Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions apps/files_sharing/lib/External/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IUserSession;
use OCP\OCM\Exceptions\OCMArgumentException;
use OCP\OCM\Exceptions\OCMProviderException;
use OCP\OCM\IOCMDiscoveryService;
use OCP\Server;
use OCP\Share\IManager as IShareManager;
Expand Down Expand Up @@ -78,18 +76,10 @@ public function __construct($options) {
$this->appConfig = Server::get(IAppConfig::class);
$this->shareManager = Server::get(IShareManager::class);

// use default path to webdav if not found on discovery
try {
$ocmProvider = $discoveryService->discover($this->cloudId->getRemote());
$webDavEndpoint = $ocmProvider->extractProtocolEntry('file', 'webdav');
$remote = $ocmProvider->getEndPoint();
$authType = \Sabre\DAV\Client::AUTH_BASIC;
} catch (OCMProviderException|OCMArgumentException $e) {
$this->logger->notice('exception while retrieving webdav endpoint', ['exception' => $e]);
$webDavEndpoint = '/public.php/webdav';
$remote = $this->cloudId->getRemote();
$authType = \Sabre\DAV\Client::AUTH_BASIC;
}
$ocmProvider = $discoveryService->discover($this->cloudId->getRemote());
$webDavEndpoint = $ocmProvider->extractProtocolEntry('file', 'webdav');
$remote = $ocmProvider->getEndPoint();
$authType = \Sabre\DAV\Client::AUTH_BASIC;

// Only use Bearer auth when an access token is already stored.
// Shares created before the exchange-token capability was introduced have no
Expand Down
Loading