浏览代码

Workaround when your proxy server fails request with enabled http_proxy_request_fulluri HTTP parameter

Alexander Loutsenko 12 年之前
父节点
当前提交
b7e41de607
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/Composer/Util/StreamContextFactory.php

+ 7 - 0
src/Composer/Util/StreamContextFactory.php

@@ -64,6 +64,13 @@ final class StreamContextFactory
             $options['http']['proxy'] = $proxyURL;
             $options['http']['request_fulluri'] = true;
 
+            if ( strtolower( getenv('http_proxy_request_fulluri') ) == 'false' ||
+                 strtolower( getenv('HTTP_PROXY_REQUEST_FULLURI') ) == 'false'
+            )
+            {
+                $options['http']['request_fulluri'] = false;
+            }
+
             if (isset($proxy['user'])) {
                 $auth = $proxy['user'];
                 if (isset($proxy['pass'])) {