Skip to content

Commit

Permalink
Update Horse.OctetStream.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
elvis.bayerl committed Aug 17, 2022
1 parent 4503ff4 commit e5dd87a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Horse.OctetStream.pas
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ procedure GetAllDataAsStream(ARequest: THorseRequest; AStream: TMemoryStream);
begin
AStream.Clear;
{$IF DEFINED(FPC)}
LStringStream := TStringStream.Create(ARequest.RawWebRequest.Content);
try
LStringStream.SaveToStream(AStream);
finally
LStringStream.Free;
end;
LStringStream := TStringStream.Create(ARequest.RawWebRequest.Content);
try
LStringStream.SaveToStream(AStream);
finally
LStringStream.Free;
end;
{$ELSE}
{$IF CompilerVersion <= 28}
Assert(Length(ARequest.RawWebRequest.RawContent) = ARequest.RawWebRequest.ContentLength);
{$ELSE}
ARequest.RawWebRequest.ReadTotalContent;
ARequest.RawWebRequest.ReadTotalContent;
{$ENDIF}

ContentLength := ARequest.RawWebRequest.ContentLength;
while ContentLength > 0 do
Expand Down

0 comments on commit e5dd87a

Please sign in to comment.