Hi,
Snoopy can't download http://journal.neilgaiman.com/ because the server gives a 404 if the request headers include:
Host: journal.neilgaiman.com:80
You get a 200 with:
Host: journal.neilgaiman.com
This is the server's fault, but here's a hack anyway:
*** Snoopy.class.php.orig 2008-05-28 16:01:16.000000000 +0100
--- Snoopy.class.php 2008-05-28 16:02:24.000000000 +0100
***************
*** 795,801 ****
$headers .= "User-Agent: ".$this->agent."\r\n";
if(!empty($this->host) && !isset($this->rawheaders['Host'])) {
$headers .= "Host: ".$this->host;
! if(!empty($this->port))
$headers .= ":".$this->port;
$headers .= "\r\n";
}
--- 795,801 ----
$headers .= "User-Agent: ".$this->agent."\r\n";
if(!empty($this->host) && !isset($this->rawheaders['Host'])) {
$headers .= "Host: ".$this->host;
! if(!empty($this->port) && $this->port != 80)
$headers .= ":".$this->port;
$headers .= "\r\n";
}
Cheers,
Ian
Logged In: NO
Thank you, very useful trick!
Yes, I recently tracked strange errors down to this line as well. But remember to also not add the default port to HTTPS connections (port 443). I definetly think this should be in the next version of Snoopy.