mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:39:09 +02:00
* Make sure error content is sent
git-svn-id: trunk@42262 -
This commit is contained in:
parent
2651f867e8
commit
ce528e1808
@ -817,6 +817,9 @@ begin
|
|||||||
IO.Response.Code:=aCode;
|
IO.Response.Code:=aCode;
|
||||||
IO.Response.CodeText:=aExtraMessage;
|
IO.Response.CodeText:=aExtraMessage;
|
||||||
IO.RestOutput.CreateErrorContent(aCode,aExtraMessage);
|
IO.RestOutput.CreateErrorContent(aCode,aExtraMessage);
|
||||||
|
IO.RESTOutput.FinalizeOutput;
|
||||||
|
IO.Response.ContentStream.Position:=0;
|
||||||
|
IO.Response.ContentLength:=IO.Response.ContentStream.Size;
|
||||||
IO.Response.SendResponse;
|
IO.Response.SendResponse;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1971,7 +1974,7 @@ begin
|
|||||||
// Make sure there is a document in case of error
|
// Make sure there is a document in case of error
|
||||||
if (aResponse.ContentStream.Size=0) and Not ((aResponse.Code div 100)=2) then
|
if (aResponse.ContentStream.Size=0) and Not ((aResponse.Code div 100)=2) then
|
||||||
IO.RESTOutput.CreateErrorContent(aResponse.Code,aResponse.CodeText);
|
IO.RESTOutput.CreateErrorContent(aResponse.Code,aResponse.CodeText);
|
||||||
if Not (IO.Operation in [roOptions,roHEAD]) then
|
if Not ((IO.Operation in [roOptions,roHEAD]) or aResponse.ContentSent) then
|
||||||
IO.RestOutput.FinalizeOutput;
|
IO.RestOutput.FinalizeOutput;
|
||||||
aResponse.ContentStream.Position:=0;
|
aResponse.ContentStream.Position:=0;
|
||||||
aResponse.ContentLength:=aResponse.ContentStream.Size;
|
aResponse.ContentLength:=aResponse.ContentStream.Size;
|
||||||
|
Loading…
Reference in New Issue
Block a user