View Issue Details

IDProjectCategoryView StatusLast Update
0031416FPCPackagespublic2017-12-29 13:44
ReporterSerge ChelliAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031416: fpWeb, apache module can't read contentFields
DescriptionWhen using an apache module with fpWeb, contentFields (POST) are not read.

I fix this bug by adding a call to ReadContent in procedure TApacheRequest.InitFromRequest of unit fpapache.pp :

procedure TApacheRequest.InitFromRequest;
Var
  H : THeader;
  V : String;
  I : Integer;
begin
  ParseCookies;
  For H in THeader do
    begin
    V:=MaybeP(apr_table_get(FRequest^.headers_in,PAnsiChar(HTTPHeaderNames[h])));
    If (V<>'') then
      SetHeader(H,V);
    end;
  // Some Specials;
  SetHeader(hhContentEncoding,MaybeP(FRequest^.content_encoding));
  SetHTTPVariable(hvHTTPVersion,MaybeP(FRequest^.protocol));
  SetHTTPVariable(hvPathInfo,MaybeP(FRequest^.path_info));
  SetHTTPVariable(hvPathTranslated,MaybeP(FRequest^.filename));
  If (FRequest^.Connection<>Nil) then
    begin
    SetHTTPVariable(hvRemoteAddress,MaybeP(FRequest^.Connection^.remote_ip));
    SetHTTPVariable(hvRemoteHost,MaybeP(ap_get_remote_host(FRequest^.Connection,
                   FRequest^.per_dir_config, REMOTE_NAME,@i)));
    end;
  V:=MaybeP(FRequest^.unparsed_uri);
  I:=Pos('?',V)-1;
  If (I=-1) then
    I:=Length(V);
  SetHTTPVariable(hvScriptName,Copy(V,1,I-Length(PathInfo)));
  SetHTTPVariable(hvServerPort,IntToStr(ap_get_server_port(FRequest)));
  SetHTTPVariable(hvMethod,MaybeP(FRequest^.method));
  SetHTTPVariable(hvURL,FRequest^.unparsed_uri);
  SetHTTPVariable(hvQuery,MaybeP(FRequest^.args));
  SetHeader(hhHost,MaybeP(FRequest^.HostName));
  ReadContent; // <-- add by Serge 2017-02-17 to read contentFields
end;

TagsNo tags attached.
Fixed in Revision37861
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2017-12-29 13:44

administrator   ~0105106

Fixed, also for apache24. Thanks for the patch

Issue History

Date Modified Username Field Change
2017-02-20 02:14 Serge Chelli New Issue
2017-02-20 09:15 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-02-20 09:15 Michael Van Canneyt Status new => assigned
2017-12-29 13:34 Michael Van Canneyt Project Packages => FPC
2017-12-29 13:44 Michael Van Canneyt Fixed in Revision => 37861
2017-12-29 13:44 Michael Van Canneyt Note Added: 0105106
2017-12-29 13:44 Michael Van Canneyt Status assigned => resolved
2017-12-29 13:44 Michael Van Canneyt Fixed in Version => 3.1.1
2017-12-29 13:44 Michael Van Canneyt Resolution open => fixed
2017-12-29 13:44 Michael Van Canneyt Target Version => 3.2.0