Skip to content

Commit

Permalink
Merge pull request #13 from elvisbayerl/Compatabilidade-XE-7
Browse files Browse the repository at this point in the history
Update Horse.OctetStream.pas (Compatibilidade Delphi XE 7)
  • Loading branch information
viniciussanchez authored Aug 23, 2022
2 parents 82cbea4 + e5dd87a commit c57c5ed
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 c57c5ed

Please sign in to comment.