diff options
author | Björn Schießle <bjoern@schiessle.org> | 2017-04-12 16:01:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 16:01:07 +0200 |
commit | b90e91144bc8d378f6f52025f04383ae2e7c647b (patch) | |
tree | 616619d3778182ac53e77dc605fc9bded595fc63 /lib/private/Share | |
parent | 3cf2f6e31bca4b704549e428d7fcbf6c4ecd6c37 (diff) | |
parent | 42f40659f664b4cdcdd5f19cf7300ad740aec6a4 (diff) | |
download | nextcloud-server-b90e91144bc8d378f6f52025f04383ae2e7c647b.tar.gz nextcloud-server-b90e91144bc8d378f6f52025f04383ae2e7c647b.zip |
Merge pull request #3614 from nextcloud/discover-federatedsharing-endpoints
Discover federatedsharing endpoints
Diffstat (limited to 'lib/private/Share')
-rw-r--r-- | lib/private/Share/Share.php | 8 |
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://'; |