Bug #14947 [Fbk]: downloadHttp() makes wrong HTTP Request when using Proxy

From: Date: Sun, 15 Feb 2009 18:52:05 +0000
Subject: Bug #14947 [Fbk]: downloadHttp() makes wrong HTTP Request when using Proxy
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-27@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=14947&edit=1 ID: 14947 Updated by: helgith@gmail.com Reported By: ifeghali at php dot net Summary: downloadHttp() makes wrong HTTP Request when using Proxy Status: Feedback Type: Bug Package: PEAR Package Version: 1.7.2 PHP Version: 5.2.6 -Roadmap Versions: +Roadmap Versions: 1.8.0alpha1 New Comment: <div id="changeset"> <span class="removed">-Roadmap Versions:</span> <span class="added">+Roadmap Versions: 1.8.0alpha1</span> </div> Igor can you please test CVS ? Previous Comments: ------------------------------------------------------------------------ [2009-02-07 13:59:25] doconnor <div id="changeset"> <span class="removed">-Status: Open</span> <span class="added">+Status: Feedback</span> </div> 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 ------------------------------------------------------------------------ [2008-11-03 10:55:42] ifeghali Beware the diff was made with the arguments inverted. ------------------------------------------------------------------------ [2008-11-03 10:53:09] ifeghali 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))) ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=14947&edit=1

« previous php.pear.bugs (#27) next »