From 8173b42a8a991f1f6d46c6e469cb5202f9509d14 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 22 Nov 2013 15:38:13 +0100 Subject: [PATCH] Force unresolvable hosts through proxies, fixes #2449 --- src/Composer/Util/NoProxyPattern.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Util/NoProxyPattern.php b/src/Composer/Util/NoProxyPattern.php index 941aedf2b..d85a0c29a 100644 --- a/src/Composer/Util/NoProxyPattern.php +++ b/src/Composer/Util/NoProxyPattern.php @@ -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); }