Merge pull request #44475 from nextcloud/fix/disabled-ipv6

This commit is contained in:
Benjamin Gaussorgues 2024-03-26 18:14:49 +01:00 committed by GitHub
commit f8d1487dcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;