Skip to content

Commit

Permalink
Merge pull request #13 from HashLoad/Fixed-Stream-Encoding
Browse files Browse the repository at this point in the history
Fixed Stream Encoding
  • Loading branch information
viniciussanchez authored Apr 10, 2023
2 parents 3a21cff + a2ffdd9 commit 35ba3bf
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 35ba3bf

Please sign in to comment.