Skip to content

Commit 5747681

Browse files
Merge pull request #16898 from nextcloud/fix/noid/only-run-proxy-when-federation-enabled
fix(federation): Don't try to federate when it's disabled
2 parents 4c25e0f + 3787922 commit 5747681

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Federation/Proxy/TalkV1/ProxyRequest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use GuzzleHttp\Exception\ServerException;
1414
use OC\Http\Client\Response;
1515
use OCA\Talk\AppInfo\Application;
16+
use OCA\Talk\Config as TalkConfig;
1617
use OCA\Talk\Exceptions\CannotReachRemoteException;
1718
use OCA\Talk\Exceptions\RemoteClientException;
1819
use OCA\Talk\Participant;
@@ -33,6 +34,7 @@ public function __construct(
3334
protected LoggerInterface $logger,
3435
protected IFactory $l10nFactory,
3536
protected IUserSession $userSession,
37+
protected TalkConfig $talkConfig,
3638
) {
3739
}
3840

@@ -119,6 +121,10 @@ protected function request(
119121
string $url,
120122
array $parameters,
121123
): IResponse {
124+
if (!$this->talkConfig->isFederationEnabled()) {
125+
throw new CannotReachRemoteException();
126+
}
127+
122128
$requestOptions = $this->generateDefaultRequestOptions($cloudId, $accessToken);
123129
if (!empty($parameters)) {
124130
$requestOptions['json'] = $parameters;

0 commit comments

Comments
 (0)