diff --git a/src/Horse.BasicAuthentication.pas b/src/Horse.BasicAuthentication.pas index 2b19e86..119f7fc 100644 --- a/src/Horse.BasicAuthentication.pas +++ b/src/Horse.BasicAuthentication.pas @@ -85,9 +85,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED Exit; end; - LBasicAuthenticationEncode := ''; - if Req.Headers.ContainsKey(Config.Header) then - LBasicAuthenticationEncode := Req.Headers.Items[Config.Header]; + LBasicAuthenticationEncode := Req.Headers[Config.Header]; if LBasicAuthenticationEncode.Trim.IsEmpty and not Req.Query.TryGetValue(Config.Header, LBasicAuthenticationEncode) then begin @@ -188,4 +186,4 @@ function THorseBasicAuthenticationConfig.SkipRoutes: TArray; Result := FSkipRoutes; end; -end. +end. \ No newline at end of file