Merge pull request #12573 from mexon/mat/local-host
Allow HTTP requests to hosts in local hosts file
This commit is contained in:
commit
03e03c126d
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ class HttpClient implements ICanSendHttpRequests
|
|||
$this->logger->debug('Request start.', ['url' => $url, 'method' => $method]);
|
||||
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
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_AAAA) && !gethostbyname($host)) {
|
||||
$this->logger->debug('URL cannot be resolved.', ['url' => $url, 'callstack' => System::callstack(20)]);
|
||||
$this->profiler->stopRecording();
|
||||
return CurlResult::createErrorCurl($url);
|
||||
|
|
Loading…
Reference in a new issue