Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #14947 downloadHttp() is missing Host part of the HTTP Request when using Proxy
Submitted: 2008-11-03 15:53 UTC
From: ifeghali Assigned: ifeghali
Status: Closed Package: PEAR (version 1.7.2)
PHP Version: 5.2.6 OS:
Roadmaps: 1.8.0alpha1    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 26 + 13 = ?

 
 [2008-11-03 15:53 UTC] ifeghali (Igor Feghali)
Description: ------------ When using a proxy `pear channel-discover XXX` won't succeed. The following patch fix that problem for me, but obviously its just an ugly hack: --- Downloader.php 2008-11-03 13:51:34.000000000 -0200 +++ /usr/share/pear/PEAR/Downloader.php 2008-11-03 11:44:07.000000000 -0200 @@ -1601,7 +1601,7 @@ return PEAR::raiseError("Connection to `$proxy_host:$proxy_port' failed: $errstr", $errno); } if ($lastmodified === false || $lastmodified) { - $request = "GET $url HTTP/1.0\r\n"; + $request = "GET $url HTTP/1.1\r\n"; } else { $request = "GET $url HTTP/1.0\r\n"; } Test script: --------------- `pear config-set http_proxy http://proxy.example.com:8080/` `pear channel-discover pear.example.com` Expected result: ---------------- Adding Channel "pear.example.com" succeeded Discovery of channel "pear.example.com" succeeded Actual result: -------------- Discovery of channel "pear.example.com" failed (channel-add: Cannot open "http://pear.example.com/channel.xml" (File http://pear.example.com:80/channel.xml not valid (received: HTTP/1.1 400 Bad Request)))

Comments

 [2008-11-03 15:55 UTC] ifeghali (Igor Feghali)
Beware the diff was made with the arguments inverted.
 [2009-02-07 18:59 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
Thank you for taking the time to report a problem with the package. This problem may have been already fixed by a previous change that is in the CVS of the package. Please log into CVS with: cvs -d :pserver:cvsread@cvs.php.net:/repository login and check out the CVS repository of this package and upgrade cvs -d :pserver:cvsread@cvs.php.net:/repository co pear-core pear upgrade pear-core/package2.xml or pear upgrade pear-core/package.xml If you are able to reproduce the bug with the latest CVS, please change the status back to "Open". Again, thank you for your continued support of PEAR. Hey Igor, give this a shot with the latest and greatest from CVS
 [2009-02-15 23:52 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Roadmap Versions: +Roadmap Versions: 1.8.0alpha1
Igor can you please test CVS ?
 [2009-02-16 17:31 UTC] ifeghali (Igor Feghali)
-Status: Feedback +Status: Open
Still the same. $ pear channel-discover pear.chiaraquartet.net Discovering channel pear.chiaraquartet.net over http:// failed with message: channel-add: Cannot open "http://pear.chiaraquartet.net/channel.xml" (File http://pear.chiaraquartet.net:80/channel.xml not valid (received: HTTP/1.1 400 Bad Request )) Trying to discover channel pear.chiaraquartet.net over https:// instead Discovery of channel "pear.chiaraquartet.net" failed (channel-add: Cannot open "https://pear.chiaraquartet.net/channel.xml" (File https://pear.chiaraquartet.net:443/channel.xml not valid (received: HTTP/1.1 400 Bad Request ))) If I unset my proxy settings, it will give me a connection error (as expected): $ pear config-set http_proxy "" config-set succeeded $ pear channel-discover pear.chiaraquartet.net Discovering channel pear.chiaraquartet.net over http:// failed with message: channel-add: Cannot open "http://pear.chiaraquartet.net/channel.xml" (Connection to `pear.chiaraquartet.net:80' failed: Connection refused) Trying to discover channel pear.chiaraquartet.net over https:// instead Discovery of channel "pear.chiaraquartet.net" failed (channel-add: Cannot open "https://pear.chiaraquartet.net/channel.xml" (Connection to `pear.chiaraquartet.net:443' failed: Connection refused))
 [2009-02-26 19:06 UTC] ifeghali (Igor Feghali)
The following patch has been added/updated: Patch Name: fix URL: patch fix
 [2009-02-26 19:06 UTC] ifeghali (Igor Feghali)
Ok found it. According to HTTP 1.1 specs it was missing the "Host" in the request. The patch fixes it.
 [2009-03-04 20:47 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Status: Open +Status: Closed -Assigned To: +Assigned To: ifeghali
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2009-03-04 20:48 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Summary: downloadHttp() makes wrong HTTP Request when using Proxy +Summary: downloadHttp() is missing Host part of the HTTP Request when using Proxy