Skip to content

Commit

Permalink
update 401
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Jul 3, 2023
1 parent 93262dc commit c649b67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion route/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,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
},
},
}))
Expand Down

0 comments on commit c649b67

Please sign in to comment.