1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

First commit to v3, #665

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-09-22 22:53:44 -07:00
parent 04f45046b1
commit 2aec0353f5
66 changed files with 656 additions and 3264 deletions

View File

@ -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
}
}