aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Share/Share.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Share/Share.php')
-rw-r--r--lib/private/Share/Share.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 924e2f68396..b3e4cb2d4aa 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -2742,12 +2742,10 @@ class Share extends Constants {
'result' => '',
];
$try = 0;
- $discoveryManager = new DiscoveryManager(
- \OC::$server->getMemCacheFactory(),
- \OC::$server->getHTTPClientService()
- );
+ $discoveryService = \OC::$server->query(\OCP\OCS\IDiscoveryService::class);
while ($result['success'] === false && $try < 2) {
- $endpoint = $discoveryManager->getShareEndpoint($protocol . $remoteDomain);
+ $federationEndpoints = $discoveryService->discover($protocol . $remoteDomain, 'FEDERATED_SHARING');
+ $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
$result = \OC::$server->getHTTPHelper()->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, $fields);
$try++;
$protocol = 'http://';