From 01d9e4dc131378e9eaa6ed91ffb6faa1392a7c8c Mon Sep 17 00:00:00 2001 From: cmyui Date: Thu, 1 Aug 2024 16:26:03 -0400 Subject: [PATCH] Support X-Ripple-Token reading from cookie --- app/method.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/method.go b/app/method.go index 0b7e3db..2152fc8 100644 --- a/app/method.go +++ b/app/method.go @@ -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 "):