Просмотр исходного кода

Patch from Atilla Borka, part of bug #13254
* Fixed a bug for Apache applications to pass the Status Code and Content
Encoding to the web server in the response.
* Fixed the header name/value pair passing for Apache applications

git-svn-id: trunk@12986 -

joost 16 лет назад
Родитель
Сommit
7389f2dbd3
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      packages/fcl-web/src/fpapache.pp

+ 8 - 2
packages/fcl-web/src/fpapache.pp

@@ -461,8 +461,8 @@ Var
   P : Pchar;
   
 begin
-  ap_setup_client_block(Frequest,REQUEST_CHUNKED_DECHUNK);
-  If (ap_should_client_block(Frequest)=1) then
+  ap_setup_client_block(FRequest,REQUEST_CHUNKED_DECHUNK);
+  If (ap_should_client_block(FRequest)=1) then
     begin
     Len:=ContentLength;
     If (Len>0) then
@@ -515,6 +515,7 @@ begin
       begin
       N:=Copy(V,1,P-1);
       System.Delete(V,1,P);
+      V := Trim(V);//no need space before the value, apache puts it there
       apr_table_set(FRequest^.headers_out,Pchar(N),Pchar(V));
       end;
     end;
@@ -530,6 +531,11 @@ begin
   S:=ContentType;
   If (S<>'') then
     FRequest^.content_type:=apr_pstrdup(FRequest^.pool,Pchar(S));
+  S:=ContentEncoding;
+  If (S<>'') then
+    FRequest^.content_encoding:=apr_pstrdup(FRequest^.pool,Pchar(S));
+  If Code <> 200 then
+    FRequest^.status := Code;
   If assigned(ContentStream) then
     SendStream(Contentstream)
   else