Skip to content

Commit

Permalink
Merge pull request #45 from davisouzatb/patch-1
Browse files Browse the repository at this point in the history
[feat] Implementado opção de HttpOnly para permitir setar token via Cookie
  • Loading branch information
viniciussanchez authored Dec 11, 2024
2 parents 8a9acf3 + 58b322f commit 1662f42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Horse.JWT.pas
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ procedure Middleware(AHorseRequest: THorseRequest; AHorseResponse: THorseRespons
LHeaderNormalize[1] := UpCase(LHeaderNormalize[1]);

LToken := AHorseRequest.Headers[LConfig.Header];
if LToken.IsEmpty then
LToken := AHorseRequest.Cookie.Items[LConfig.Header];

if LToken.Trim.IsEmpty and not AHorseRequest.Query.TryGetValue(
LConfig.Header, LToken) and not AHorseRequest.Query.TryGetValue(
LHeaderNormalize, LToken) then
Expand Down

0 comments on commit 1662f42

Please sign in to comment.