Skip to content

Commit

Permalink
Fixed Stream Encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
dliocode committed Mar 31, 2023
1 parent 3a21cff commit a2ffdd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Horse.Compression.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2ffdd9

Please sign in to comment.