瀏覽代碼

fix pull 6740

wrongly copied the check, either must be in not-empty
croensch 7 年之前
父節點
當前提交
bd6168ef85
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Util/StreamContextFactory.php

+ 1 - 1
src/Composer/Util/StreamContextFactory.php

@@ -55,7 +55,7 @@ final class StreamContextFactory
         }
 
         // Remove proxy if URL matches no_proxy directive
-        if (!empty($_SERVER['NO_PROXY']) || $_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) {
+        if (!empty($_SERVER['NO_PROXY']) || !empty($_SERVER['no_proxy']) && parse_url($url, PHP_URL_HOST)) {
             $pattern = new NoProxyPattern(!empty($_SERVER['no_proxy']) ? $_SERVER['no_proxy'] : $_SERVER['NO_PROXY']);
             if ($pattern->test($url)) {
                 unset($proxy);