Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 15 additions & 11 deletions apps/federatedfilesharing/lib/DiscoveryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,26 @@ private function ocmDiscover($remote) {
$decodedService = $this->makeRequest($remote . '/ocm-provider/');
if (!empty($decodedService) && $decodedService['enabled'] === true) {
$discoveredServices['ocm'] = $decodedService['endPoint'];
$shareTypes = $decodedService['shareTypes'];
foreach ($shareTypes as $type) {
$types = [];
if (isset($decodedService['shareTypes'])) {
$types = $decodedService['shareTypes'];
} elseif (isset($decodedService['resourceTypes'])) {
$types = $decodedService['resourceTypes'];
}
foreach ($types as $type) {
if ($type['name'] == 'file') {
$discoveredServices['webdav'] = $type['protocols']['webdav'];
}
}
} else {
return [
'webdav' => false,
'ocm' => false,
];
}

// Write into cache
$this->cache->set('OCM' . $remote, \json_encode($discoveredServices));
return $discoveredServices;
// Write into cache
$this->cache->set('OCM' . $remote, \json_encode($discoveredServices));
return $discoveredServices;
}
return [
'webdav' => false,
'ocm' => false,
];
}

/**
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/38751
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Correctly parse different ocm-provider api responses

Some WebDAV service providers returns different responses for ocm-provider API
and we were not able to parse these responses. This problem has been fixed.

https://github.com/owncloud/core/pull/38751