Skip to content

Commit

Permalink
Support X-Ripple-Token reading from cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Aug 1, 2024
1 parent c25347d commit 01d9e4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func initialCaretaker(c *fasthttp.RequestCtx, f func(md common.MethodData) commo
var token string
var bearerToken bool
switch {
case len(c.Request.Header.CookieBytes([]byte("X-Ripple-Token"))) > 0:
token = string(c.Request.Header.CookieBytes([]byte("X-Ripple-Token")))
case len(c.Request.Header.Peek("X-Ripple-Token")) > 0:
token = string(c.Request.Header.Peek("X-Ripple-Token"))
case strings.HasPrefix(string(c.Request.Header.Peek("Authorization")), "Bearer "):
Expand Down

0 comments on commit 01d9e4d

Please sign in to comment.