Skip to content

Commit

Permalink
fix(dns): detect disabled IPv6 support in DNS pinning
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Gaussorgues <[email protected]>
  • Loading branch information
Altahrim committed Mar 26, 2024
1 parent 47ac907 commit 7e4be1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/private/Http/Client/DnsPinMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ private function dnsResolve(string $target, int $recursionCount) : array {
$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;
Expand Down

0 comments on commit 7e4be1f

Please sign in to comment.