From a2ffdd96da9492f927f235aa3fe1afc192eacfcd Mon Sep 17 00:00:00 2001 From: Danilo Lucas Date: Fri, 31 Mar 2023 09:13:17 -0300 Subject: [PATCH] Fixed Stream Encoding --- src/Horse.Compression.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Horse.Compression.pas b/src/Horse.Compression.pas index bac291d..f5a4f76 100644 --- a/src/Horse.Compression.pas +++ b/src/Horse.Compression.pas @@ -61,7 +61,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED if Trim(Res.RawWebResponse.Content) = EmptyStr then LStringStream := TStringStream.Create({$IF DEFINED(FPC)}TJsonData(Res.Content).AsJSON{$ELSE}TJSONValue(Res.Content).ToJSON{$ENDIF}) else - LStringStream := TStringStream.Create(Res.RawWebResponse.Content); + LStringStream := TStringStream.Create(Res.RawWebResponse.Content {$IF NOT DEFINED(FPC)}, TEncoding.UTF8{$ENDIF}); if LStringStream.Size <= CompressionThreshold then Exit; LMemoryStream := TMemoryStream.Create;