From dfeed76a66889b19fa4e297e29839278fd502333 Mon Sep 17 00:00:00 2001 From: LinkLeong Date: Mon, 3 Jul 2023 10:08:05 +0100 Subject: [PATCH] Update permission issues --- route/v2.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/route/v2.go b/route/v2.go index 8d346c6..00832a8 100644 --- a/route/v2.go +++ b/route/v2.go @@ -79,7 +79,10 @@ func InitV2Router() http.Handler { }, TokenLookupFuncs: []echo_middleware.ValuesExtractor{ func(c echo.Context) ([]string, error) { - return []string{c.Request().Header.Get(echo.HeaderAuthorization)}, nil + if len(c.Request().Header.Get(echo.HeaderAuthorization)) > 0 { + return []string{c.Request().Header.Get(echo.HeaderAuthorization)}, nil + } + return []string{c.QueryParam("token")}, nil }, }, }))