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

Bug #8254 downloading doesn't work with 302 messages
Submitted: 2006-07-20 05:32 UTC
From: cweiske Assigned: cellog
Status: Closed Package: PEAR (version 1.4.10)
PHP Version: 5.1.4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


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 : 27 + 17 = ?

 
 [2006-07-20 05:32 UTC] cweiske (Christian Weiske)
Description: ------------ Downloading packages doesn't always work: Try to "pear install http://matrix.squiz.net/download/PHP_CodeSniffer.tgz" (the package from http://pear.php.net/pepr/pepr-proposal-show.php?id=426) and pear will give you the error Could not download from "http://matrix.squiz.net/download/PHP_CodeSniffer.tgz" Invalid or missing remote package file Package "http://matrix.squiz.net/download/PHP_CodeSniffer.tgz" is not valid install failed When downloading with wget, I see that the file is redirected: Resolving matrix.squiz.net... 202.125.172.199 Connecting to matrix.squiz.net|202.125.172.199|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://matrix.squiz.net/__data/assets/file/0005/9725/PHP_CodeSniffer-0.0.1.tgz [following] --07:27:25-- http://matrix.squiz.net/__data/assets/file/0005/9725/PHP_CodeSniffer-0.0.1.tgz => `PHP_CodeSniffer-0.0.1.tgz' The PEAR downloader should be able handle this.

Comments

 [2006-09-02 10:14 UTC] bjori (Hannes Magnusson)
Technically there is no "Host" header in HTTP/1.0 but 99.9% webservers out there does however support it. Adding :portNumber in back of the host is pushing it to far. The following patch (against current cvs) fixes it: http://php.is/bugs/pear/pear.downloader.http10.patch.txt
 [2006-09-02 10:17 UTC] cweiske (Christian Weiske)
Hannes, I don't see where this helps with a 302 redirect?
 [2006-09-02 17:42 UTC] bjori (Hannes Magnusson)
Thats the point, you don't get the 302 redirect. PEAR Downloader works just fine with 302 redirects. In this case you are getting 404 error...
 [2006-09-05 15:49 UTC] cweiske (Christian Weiske)
Ok, now I understand. But is it allowed to include the port in the host header at all?
 [2006-09-05 16:19 UTC] bjori (Hannes Magnusson)
In HTTP/1.1 the Host header MUST be included. The port number is optional.
 [2006-09-18 16:36 UTC] cellog (Greg Beaver)
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. thanks guys - I love patches. :)