1
0
Fork 0

Force unresolvable hosts through proxies, fixes #2449

pull/2452/merge
Jordi Boggiano 2013-11-22 15:38:13 +01:00
parent 730dcbb80a
commit 8173b42a8a
1 changed files with 3 additions and 1 deletions

View File

@ -73,8 +73,10 @@ class NoProxyPattern
if (strpos($ruleHost, '/') === false) {
$match = $ip === $ruleHost;
} else {
// gethostbyname() failed to resolve $host to an ip, so we assume
// it must be proxied to let the proxy's DNS resolve it
if ($ip === $host) {
throw new \RuntimeException('gethostbyname() failed to resolve "'.$host.'" to an IP, can not evaluate NO_PROXY rules');
$match = false;
}
$match = self::inCIDRBlock($ruleHost, $ip);
}