Delphi2009/Indy bug TIdCustomHTTPServer.DoExecute

Giganews Newsgroups
Subject: Delphi2009/Indy bug TIdCustomHTTPServer.DoExecute
Posted by:  Marius (tomuchspam@home.org)
Date: Thu, 11 Sep 2008

I downloaded the svn tiburon version of indy but i encountered 1 simple
problem in the idCustomHttpServer.pas. The UnparsedParams is not filled
correctly and that has something todo with the last update of the unit.

I changed/fixed it by giving the UnparsedParams the right value first
and then assigning that value to FormParams if contenttype =
application/x-www-form-urlencoded.

This works for us at the moment, hope this is a correct solution.

Greetings,
Marius

function TIdCustomHTTPServer.DoExecute(AContext:TIdContext): boolean;

......
......

              // reset back to 0 before reading the string from the
post stream
              LRequestInfo.PostStream.Position := 0;
              LRequestInfo.UnparsedParams :=
ReadStringFromStream(LRequestInfo.PostStream);
              if TextIsSame(LRequestInfo.ContentType,
'application/x-www-form-urlencoded') then begin    {Do not Localize}
                LRequestInfo.FormParams := LRequestInfo.UnparsedParams;
              end;

......
......

Replies