mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 11:49:24 +02:00
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 -
This commit is contained in:
parent
13d79f4352
commit
7389f2dbd3
@ -461,8 +461,8 @@ Var
|
|||||||
P : Pchar;
|
P : Pchar;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ap_setup_client_block(Frequest,REQUEST_CHUNKED_DECHUNK);
|
ap_setup_client_block(FRequest,REQUEST_CHUNKED_DECHUNK);
|
||||||
If (ap_should_client_block(Frequest)=1) then
|
If (ap_should_client_block(FRequest)=1) then
|
||||||
begin
|
begin
|
||||||
Len:=ContentLength;
|
Len:=ContentLength;
|
||||||
If (Len>0) then
|
If (Len>0) then
|
||||||
@ -515,6 +515,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
N:=Copy(V,1,P-1);
|
N:=Copy(V,1,P-1);
|
||||||
System.Delete(V,1,P);
|
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));
|
apr_table_set(FRequest^.headers_out,Pchar(N),Pchar(V));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -530,6 +531,11 @@ begin
|
|||||||
S:=ContentType;
|
S:=ContentType;
|
||||||
If (S<>'') then
|
If (S<>'') then
|
||||||
FRequest^.content_type:=apr_pstrdup(FRequest^.pool,Pchar(S));
|
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
|
If assigned(ContentStream) then
|
||||||
SendStream(Contentstream)
|
SendStream(Contentstream)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user