Skip to content

Commit

Permalink
Merge pull request #13 from HashLoad/fix-bypass-root-route-in-lazarus
Browse files Browse the repository at this point in the history
(fix)  bypass root route in lazarus
  • Loading branch information
viniciussanchez committed Feb 17, 2022
2 parents 8d27b53 + 85dc014 commit d3f4479
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Horse.BasicAuthentication.pas
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINED
LBase64String: string;
LBasicAuthenticationDecode: TStringList;
LIsAuthenticated: Boolean;
LPathInfo: string;
begin
if MatchText(Req.RawWebRequest.PathInfo, Config.SkipRoutes) then
LPathInfo := Req.RawWebRequest.PathInfo;
if LPathInfo = EmptyStr then
LPathInfo := '/';
if MatchText(LPathInfo, Config.SkipRoutes) then
begin
Next();
Exit;
Expand Down Expand Up @@ -186,4 +190,4 @@ function THorseBasicAuthenticationConfig.SkipRoutes: TArray<string>;
Result := FSkipRoutes;
end;

end.
end.

0 comments on commit d3f4479

Please sign in to comment.