From 1550ce2764e5237bb0895c01a1c7753ac75855e4 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Sat, 6 Jan 2024 23:56:11 +0100 Subject: [PATCH] allow hosts to be validated even if ipv6 fails --- src/Network/HTTPClient/Client/HttpClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/HTTPClient/Client/HttpClient.php b/src/Network/HTTPClient/Client/HttpClient.php index 9d0638a8ef..bc86579f6d 100644 --- a/src/Network/HTTPClient/Client/HttpClient.php +++ b/src/Network/HTTPClient/Client/HttpClient.php @@ -73,7 +73,7 @@ class HttpClient implements ICanSendHttpRequests throw new \InvalidArgumentException('Unable to retrieve the host in URL: ' . $url); } - if(!filter_var($host, FILTER_VALIDATE_IP) && !@dns_get_record($host . '.', DNS_A + DNS_AAAA)) { + if(!filter_var($host, FILTER_VALIDATE_IP) && !@dns_get_record($host . '.', DNS_A) && !@dns_get_record($host . '.', DNS_AAAA)) { $this->logger->debug('URL cannot be resolved.', ['url' => $url]); $this->profiler->stopRecording(); return CurlResult::createErrorCurl($this->logger, $url); -- 2.39.5