diff --git a/src/Horse.OctetStream.pas b/src/Horse.OctetStream.pas index a1d3583..2de9c91 100644 --- a/src/Horse.OctetStream.pas +++ b/src/Horse.OctetStream.pas @@ -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