mirror of
https://github.com/labstack/echo.git
synced 2025-07-15 01:34:53 +02:00
@ -153,7 +153,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
|
||||
// jwtFromHeader returns a `jwtExtractor` that extracts token from request header.
|
||||
func jwtFromHeader(header string) jwtExtractor {
|
||||
return func(c echo.Context) (string, error) {
|
||||
auth := c.Request().Header().Get(header)
|
||||
auth := c.Request().Header.Get(header)
|
||||
l := len(bearer)
|
||||
if len(auth) > l+1 && auth[:l] == bearer {
|
||||
return auth[l+1:], nil
|
||||
@ -181,6 +181,6 @@ func jwtFromCookie(name string) jwtExtractor {
|
||||
if err != nil {
|
||||
return "", errors.New("empty jwt in cookie")
|
||||
}
|
||||
return cookie.Value(), nil
|
||||
return cookie.Value, nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user