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
fix(OCM): Fix OCM provider discovery for servers without beautiful URLs
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Nov 2, 2023
commit 44249183133bcda3db4d75b6f6849b45fb689c9b
5 changes: 4 additions & 1 deletion lib/private/OCM/OCMDiscoveryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public function __construct(
*/
public function discover(string $remote, bool $skipCache = false): IOCMProvider {
$remote = rtrim($remote, '/');
if (str_ends_with($remote, '/index.php')) {
$remote = substr($remote, 0, -10);
}

if (!$skipCache) {
try {
Expand All @@ -84,7 +87,7 @@ public function discover(string $remote, bool $skipCache = false): IOCMProvider
$client = $this->clientService->newClient();
try {
$response = $client->get(
$remote . '/ocm-provider/',
$remote . '/index.php/ocm-provider/',
[
'timeout' => 10,
'verify' => !$this->config->getSystemValueBool('sharing.federation.allowSelfSignedCertificates'),
Expand Down