diff options
author | georglauterbach <44545919+georglauterbach@users.noreply.github.com> | 2024-10-13 08:21:03 +0000 |
---|---|---|
committer | georglauterbach <44545919+georglauterbach@users.noreply.github.com> | 2024-11-06 20:21:38 +0100 |
commit | 387cd8b771d5baefdc8a3ffb22ee00458310b3dd (patch) | |
tree | bcbe674a905fc261674aaf49d41519f6dc62041b /lib | |
parent | de30fadaf5da7eea098d7cae1b0aed9836b3246a (diff) | |
download | nextcloud-server-387cd8b771d5baefdc8a3ffb22ee00458310b3dd.tar.gz nextcloud-server-387cd8b771d5baefdc8a3ffb22ee00458310b3dd.zip |
fix: do not query CNAME if A succeeded already
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Http/Client/DnsPinMiddleware.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php index 6618f22d825..08dbf88a8a8 100644 --- a/lib/private/Http/Client/DnsPinMiddleware.php +++ b/lib/private/Http/Client/DnsPinMiddleware.php @@ -57,17 +57,21 @@ class DnsPinMiddleware { $soaDnsEntry = $this->soaRecord($target); $dnsNegativeTtl = $soaDnsEntry['minimum-ttl'] ?? null; + $canHaveCnameRecord = true; $dnsTypes = \defined('AF_INET6') || @inet_pton('::1') ? [DNS_A, DNS_AAAA, DNS_CNAME] : [DNS_A, DNS_CNAME]; foreach ($dnsTypes as $dnsType) { + if ($canHaveCnameRecord === false && $dnsType === DNS_CNAME) { + continue; + } + if ($this->negativeDnsCache->isNegativeCached($target, $dnsType)) { continue; } $dnsResponses = $this->dnsGetRecord($target, $dnsType); - $canHaveCnameRecord = true; if ($dnsResponses !== false && count($dnsResponses) > 0) { foreach ($dnsResponses as $dnsResponse) { if (isset($dnsResponse['ip'])) { |