Skip to content

Commit edbdaa1

Browse files
Update Horse.BasicAuthentication.pas
1 parent 32c3581 commit edbdaa1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Horse.BasicAuthentication.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
3434
LBasicAuthenticationDecode: TStringList;
3535
LIsAuthenticated: Boolean;
3636
begin
37-
if not Req.Headers.TryGetValue(Header, LBasicAuthenticationEncode) and not Req.Query.TryGetValue(Header, LBasicAuthenticationEncode) then
37+
LBasicAuthenticationEncode := Req.Headers[Header];
38+
if LBasicAuthenticationEncode.Trim.IsEmpty and not Req.Query.TryGetValue(Header, LBasicAuthenticationEncode) then
3839
begin
3940
Res.Send('Authorization not found').Status(401);
4041
raise EHorseCallbackInterrupted.Create;

0 commit comments

Comments
 (0)