Skip to content

Commit

Permalink
Checking for the existence of the Accept-Encoding header
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosHe committed Dec 22, 2021
1 parent 4ed28e0 commit b018c42
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 @@ -45,7 +45,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED
LContent := Res.Content;
if (not Assigned(LContent)) or (not LContent.InheritsFrom({$IF DEFINED(FPC)}TJsonData{$ELSE}TJSONValue{$ENDIF})) then
Exit;
if not Req.Headers.Contains(ACCEPT_ENCODING) then
if not Req.Headers.ContainsKey(ACCEPT_ENCODING) then
Exit;
LAcceptEncoding := Req.Headers[ACCEPT_ENCODING].ToLower;
if Pos(THorseCompressionType.DEFLATE.ToString, LAcceptEncoding) > 0 then
Expand Down

0 comments on commit b018c42

Please sign in to comment.