[fpc-pascal] fphttpclient get an url with colon

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Feb 17 02:35:56 CET 2012


Hi,

When I use TFPHTTPClient to fetch a page with a colon in the file name
it appends a slash "/". For example:

  Client:=TFPHTTPClient.Create(nil);
  Response:=TMemoryStream.Create;
  Client.Get('http://wiki.lazarus.freepascal.org/Image:Acs_demos.jpg',Response);

It fetches "/Image:Acs_demos.jpg/".

The / is appended in ParseURI when extracting the document name. For
some reason it stops at a colon:

  // now s is 'hier-part' per RFC3986
  // Extract the document name (nasty...)

  for i := Length(s) downto 1 do
    if s[i] = '/' then
    begin
      ...
    end else if s[i] = ':' then
      break
    else 
      ...

Why?


Mattias



More information about the fpc-pascal mailing list