Skip to content

Commit 387dcf5

Browse files
authored
Merge pull request #12 from HashLoad/Adjusted-Bug-ContainsKey
Fix bug ContainsKey
2 parents fa12996 + 6ef2905 commit 387dcf5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Horse.BasicAuthentication.pas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED
8585
Exit;
8686
end;
8787

88-
LBasicAuthenticationEncode := '';
89-
if Req.Headers.ContainsKey(Config.Header) then
90-
LBasicAuthenticationEncode := Req.Headers.Items[Config.Header];
88+
LBasicAuthenticationEncode := Req.Headers[Config.Header];
9189

9290
if LBasicAuthenticationEncode.Trim.IsEmpty and not Req.Query.TryGetValue(Config.Header, LBasicAuthenticationEncode) then
9391
begin
@@ -188,4 +186,4 @@ function THorseBasicAuthenticationConfig.SkipRoutes: TArray<string>;
188186
Result := FSkipRoutes;
189187
end;
190188

191-
end.
189+
end.

0 commit comments

Comments
 (0)