diff --git a/src/Horse.Compression.pas b/src/Horse.Compression.pas index 0fff4b2..cf1ba6e 100644 --- a/src/Horse.Compression.pas +++ b/src/Horse.Compression.pas @@ -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