pear2/HTTP_Request — Issue #5: HTTP_Request, http proxy issue
Author: olofa
Created: 2011-12-22 07:44:56+00:00
State: open

Hi,

I'm using php 5.3.2 and pyrus 2.0.0a3. I have also tried with php 5.3.8.

I did:

pyrus set http_proxy fqdn:port

I run tcpdump on the http proxy server and this is what I get when trying to install a package:

GET /rest/p/pear2_net_transmitter/info.xml HTTP/1.0
Host: pear2.php.net
User-Agent: PEAR2_Pyrus/2.0.0a3/PHP/5.3.2
Accept:

Our squid3 proxy doesn't accept that. It wants to have it like this:

GET http://pear2.php.net/rest/p/pear2_net_transmitter/info.xml HTTP/1.0
Host: pear2.php.net
User-Agent: PEAR2_Pyrus/2.0.0a3/PHP/5.3.2
Accept:

Saltybeagle suggested that this is a bug in HTTP_Requst.

I guess the problem is on line 312 in ./src/HTTP/Request/Adapter/Phpsocket.php. First shot would be to change it into:

$httpRequest = "$this->verb http://$host/$path $this->httpVersion\r\n";