Skip to content

Commit

Permalink
Merge pull request #26 from gabrielbaltazar/master
Browse files Browse the repository at this point in the history
(fix) bypass root route in lazarus
  • Loading branch information
viniciussanchez authored Feb 17, 2022
2 parents 83f9427 + d69a3ab commit bf4bf8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Horse.JWT.pas
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ procedure Middleware(AHorseRequest: THorseRequest;
LValidations: IJOSEConsumer;
LJWT: TJOSEContext;
{$ENDIF}
LPathInfo: string;
LToken, LHeaderNormalize: string;
LSession: TObject;
LJSON: TJSONObject;
Expand Down Expand Up @@ -156,7 +157,10 @@ procedure Middleware(AHorseRequest: THorseRequest;
end;
{$ENDIF}
begin
if MatchText(AHorseRequest.RawWebRequest.PathInfo, Config.SkipRoutes) then
LPathInfo := AHorseRequest.RawWebRequest.PathInfo;
if LPathInfo = EmptyStr then
LPathInfo := '/';
if MatchText(LPathInfo, Config.SkipRoutes) then
begin
ANext();
Exit;
Expand Down

0 comments on commit bf4bf8b

Please sign in to comment.