소스 검색

Fixing ZF-4259 - HTTPS proxy better handling of path string, avoiding redirection problems with some servers
(report and fix proposed by John Hopper)


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17014 44c647ce-9c0f-0410-b52a-842ac1e357ba

shahar 16 년 전
부모
커밋
0ae3afe53f
2개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 1
      library/Zend/Http/Client/Adapter/Proxy.php
  2. 1 1
      library/Zend/Http/Client/Adapter/Socket.php

+ 9 - 1
library/Zend/Http/Client/Adapter/Proxy.php

@@ -145,7 +145,15 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
         $this->method = $method;
 
         // Build request headers
-        $request = "{$method} {$uri->__toString()} HTTP/{$http_ver}\r\n";
+        if ($this->negotiated) {
+            $path = $uri->getPath();
+            if ($uri->getQuery()) { 
+                $path .= '?' . $uri->getQuery();
+            }
+            $request = "$method $path HTTP/$http_ver\r\n";
+        } else {
+            $request = "$method $uri HTTP/$http_ver\r\n";
+        }
 
         // Add all headers to the request string
         foreach ($headers as $k => $v) {

+ 1 - 1
library/Zend/Http/Client/Adapter/Socket.php

@@ -393,7 +393,7 @@ class Zend_Http_Client_Adapter_Socket implements Zend_Http_Client_Adapter_Interf
         if (isset($headers['connection']) && $headers['connection'] == 'close') {
             $this->close();
         }
-
+        
         return $response;
     }