Skip to content

Commit bf4bf8b

Browse files
Merge pull request #26 from gabrielbaltazar/master
(fix) bypass root route in lazarus
2 parents 83f9427 + d69a3ab commit bf4bf8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Horse.JWT.pas

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ procedure Middleware(AHorseRequest: THorseRequest;
111111
LValidations: IJOSEConsumer;
112112
LJWT: TJOSEContext;
113113
{$ENDIF}
114+
LPathInfo: string;
114115
LToken, LHeaderNormalize: string;
115116
LSession: TObject;
116117
LJSON: TJSONObject;
@@ -156,7 +157,10 @@ procedure Middleware(AHorseRequest: THorseRequest;
156157
end;
157158
{$ENDIF}
158159
begin
159-
if MatchText(AHorseRequest.RawWebRequest.PathInfo, Config.SkipRoutes) then
160+
LPathInfo := AHorseRequest.RawWebRequest.PathInfo;
161+
if LPathInfo = EmptyStr then
162+
LPathInfo := '/';
163+
if MatchText(LPathInfo, Config.SkipRoutes) then
160164
begin
161165
ANext();
162166
Exit;

0 commit comments

Comments
 (0)