aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorDaniel <mail@danielkesselberg.de>2024-10-01 20:41:42 +0200
committerGitHub <noreply@github.com>2024-10-01 20:41:42 +0200
commit1c1f48830ad1a70628d14fbed7a7d76065818a56 (patch)
treeefc68f7d13bdb9f3d758914bff8c1d999db545fd /lib/private
parent4bfa30620df1b3aef99beab5fd69d296108f3d2e (diff)
parent6be00432b75a80a246246883c5fa955ce803f3d8 (diff)
downloadnextcloud-server-1c1f48830ad1a70628d14fbed7a7d76065818a56.tar.gz
nextcloud-server-1c1f48830ad1a70628d14fbed7a7d76065818a56.zip
Merge pull request #48451 from nextcloud/bug/noid/federated-addressbook-sync-without-localaddressallowed
fix: make federation address book sync work with allow_local_remote_servers = false
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Http/Client/Client.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php
index 40ce012cd1a..62209ff9040 100644
--- a/lib/private/Http/Client/Client.php
+++ b/lib/private/Http/Client/Client.php
@@ -158,14 +158,15 @@ class Client implements IClient {
}
protected function preventLocalAddress(string $uri, array $options): void {
- if ($this->isLocalAddressAllowed($options)) {
- return;
- }
-
$host = parse_url($uri, PHP_URL_HOST);
if ($host === false || $host === null) {
throw new LocalServerException('Could not detect any host');
}
+
+ if ($this->isLocalAddressAllowed($options)) {
+ return;
+ }
+
if (!$this->remoteHostValidator->isValid($host)) {
throw new LocalServerException('Host "' . $host . '" violates local access rules');
}