Merge pull request #13808 from mexon/allow-ipv6-failure

allow hosts to be validated even if ipv6 fails
This commit is contained in:
Hypolite Petovan 2024-01-06 21:03:52 -05:00 committed by GitHub
commit bbd3e75399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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