I've a problem receiving a favicon.ico from a specific web server using Delphi and Indy 9/10. Other servers do work fine. The problem is not with this web server, as wget command line utility gets the file correctly.
here is the output from wget:
c:\a>wget http://perforce.eigenbase.org:8080/favicon.ico
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:/progra~1/wget/etc/wgetrc
--2013-01-27 00:12:39-- http://perforce.eigenbase.org:8080/favicon.ico
Resolving perforce.eigenbase.org... 72.14.190.177
Connecting to perforce.eigenbase.org|72.14.190.177|:8080... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: `favicon.ico'
[ <=> ] 2.862 --.-K/s in 0s
2013-01-27 00:12:40 (143 MB/s) - `favicon.ico' saved [2862]
Here is my Delphi Indy 9/10 example code. It generates a "Connection Closed Gracefully" Exception, and the result is an empty string.
procedure TForm1.Button1Click(Sender: TObject);
var s: string;
begin
s := '';
try
s := IdHTTP1.Get('http://perforce.eigenbase.org:8080/favicon.ico');
except
on E: Exception do
begin
{$IFDEF DEBUG}ShowMessage('get error:'+E.Message){$ENDIF};
end;
end;
ShowMessage(IntToStr(Length(s)));
end;
If I try the same code with a different server, for example:
s := IdHTTP1.Get('http://www.google.com/favicon.ico');
everything works just fine.
Is there a workaround to get the http://perforce.eigenbase.org:8080/favicon.ico file using IdHTTP1.Get from the server?