[fpc-pascal] Premature end of headers using fcl-web and POST

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Mon Oct 31 16:43:19 CET 2011


Ok, the exception was a great addition =)

It corners the error here:

procedure TRequest.InitPostVars;
Var
  M  : TCapacityStream;
  Cl : Integer;
  B  : Byte;
  CT : String;

begin
{$ifdef CGIDEBUG}
  SendMethodEnter('InitPostVars');
{$endif}
  CL:=ContentLength;
  M:=TCapacityStream.Create;
  Try
    if CL<>0 then
      begin
      M.Capacity:=Cl;
      M.WriteBuffer(Content[1], Cl);
      end;
    M.Position:=0;
    CT:=ContentType;
    if Pos('MULTIPART/FORM-DATA',Uppercase(CT))<>0 then
      ProcessMultiPart(M,CT, ContentFields)
    else if Pos('APPLICATION/X-WWW-FORM-URLENCODED',Uppercase(CT))<>0 then
      ProcessUrlEncoded(M, ContentFields)
    else if CL<>0 then
      begin
{$ifdef CGIDEBUG}
      SendDebug('InitPostVars: unsupported content type:'+CT);
{$endif}
      Raise Exception.CreateFmt(SErrUnsupportedContentType,[CT]);
<------- error here


-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list