I was trying to fetch the URL
"http://www.heise-security.co.uk/news/news-atom.xml" and found that I was
always getting a 404, not only for this URL but the whole site. After some
investigation it turns out that Snoopy sends a slightly wrong Host header:
Host: www.heise-security.co.uk:80
I didn't check the RFC if this is allowed or not, but I would never even
try that. You go to the port and then you ask for the hostname, not for
hostname:port. Even if it is allowed (and some servers seem to ignore it or
I would have encountered the problem earlier) it's redundant since you
cannot go to port 1000 and then ask for host domain:1111 for instance.
So, I think the correct bugfix is to completely remove
if(!empty($this->port))
$headers .= ":".$this->port;
(around line 800, maybe it's in the other functions as well, I didn't check
them yet)
While troubleshooting this I missed a method to display the request
headers. I tried rawheaders, but that is always an empty array it seems.
And I'm not sure if it should contain them, anyway, I just rushed thru the
class since I wanted to find the problem with this site quickly.
Would be nice to add this.
And you forgot to update the Version: information in the copyright section
of the class. I actually fetched 1.2.3 twice because I thought I had still
1.01 ;-)
Apart from that, many thanks for this nice and easy to use http client! I
came about it when building an application that uses magpie to process RSS
feeds.
Nobody/Anonymous
None
None
Public
|
Date: 2009-01-07 05:46 du2OYB <a href="http://jfzfiicedwwe.com/">jfzfiicedwwe</a>, |
|
Date: 2007-07-16 13:13
|
|
Date: 2007-05-04 04:05
|
|
Date: 2007-03-19 01:42
|
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use