diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-03-26 10:25:06 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-03-26 12:04:51 +0100 |
commit | 7e4be1fcfd5f652345848257472b9bfb3285779a (patch) | |
tree | 0e5d1d21883d6e719480adbe17a907d217b1c9a8 /lib/private/Http/Client | |
parent | 47ac9071492b2f1f1055bbc4ddcfb65aa28d8e1e (diff) | |
download | nextcloud-server-7e4be1fcfd5f652345848257472b9bfb3285779a.tar.gz nextcloud-server-7e4be1fcfd5f652345848257472b9bfb3285779a.zip |
fix(dns): detect disabled IPv6 support in DNS pinning
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'lib/private/Http/Client')
-rw-r--r-- | lib/private/Http/Client/DnsPinMiddleware.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php index 518281e4af0..0d2f8d0bdc8 100644 --- a/lib/private/Http/Client/DnsPinMiddleware.php +++ b/lib/private/Http/Client/DnsPinMiddleware.php @@ -75,7 +75,9 @@ class DnsPinMiddleware { $soaDnsEntry = $this->soaRecord($target); $dnsNegativeTtl = $soaDnsEntry['minimum-ttl'] ?? null; - $dnsTypes = [DNS_A, DNS_AAAA, DNS_CNAME]; + $dnsTypes = \defined('AF_INET6') || @inet_pton('::1') + ? [DNS_A, DNS_AAAA, DNS_CNAME] + : [DNS_A, DNS_CNAME]; foreach ($dnsTypes as $dnsType) { if ($this->negativeDnsCache->isNegativeCached($target, $dnsType)) { continue; |