Skip to content

Commit 32c3581

Browse files
Code improvements
1 parent 882960b commit 32c3581

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Horse.BasicAuthentication.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function HorseBasicAuthentication(const AAuthenticate: THorseBasicAuthentication
2828

2929
procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
3030
const
31-
BASIC_AUTH = 'Basic ';
31+
BASIC_AUTH = 'basic ';
3232
var
3333
LBasicAuthenticationEncode: string;
3434
LBasicAuthenticationDecode: TStringList;
@@ -39,7 +39,7 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
3939
Res.Send('Authorization not found').Status(401);
4040
raise EHorseCallbackInterrupted.Create;
4141
end;
42-
if not LBasicAuthenticationEncode.StartsWith(BASIC_AUTH) then
42+
if not LBasicAuthenticationEncode.ToLower.StartsWith(BASIC_AUTH) then
4343
begin
4444
Res.Send('Invalid authorization type').Status(401);
4545
raise EHorseCallbackInterrupted.Create;

0 commit comments

Comments
 (0)