From b018c423421e3472ce70e5ee8cea762cc0937e02 Mon Sep 17 00:00:00 2001 From: CarlosHe Date: Wed, 22 Dec 2021 19:45:47 -0300 Subject: [PATCH] Checking for the existence of the Accept-Encoding header --- 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 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