* Make sure error content is sent

git-svn-id: trunk@42262 -
This commit is contained in:
michael 2019-06-22 07:16:19 +00:00
parent 2651f867e8
commit ce528e1808

View File

@ -817,6 +817,9 @@ begin
IO.Response.Code:=aCode;
IO.Response.CodeText:=aExtraMessage;
IO.RestOutput.CreateErrorContent(aCode,aExtraMessage);
IO.RESTOutput.FinalizeOutput;
IO.Response.ContentStream.Position:=0;
IO.Response.ContentLength:=IO.Response.ContentStream.Size;
IO.Response.SendResponse;
end;
@ -1971,7 +1974,7 @@ begin
// Make sure there is a document in case of error
if (aResponse.ContentStream.Size=0) and Not ((aResponse.Code div 100)=2) then
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;
aResponse.ContentStream.Position:=0;
aResponse.ContentLength:=aResponse.ContentStream.Size;