Skip to content

Commit

Permalink
Bearer token does not contain a colon
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Smith committed Dec 1, 2023
1 parent e7d2fc0 commit 2d89883
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lambda/shared/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (v JWTVerifier) VerifyToken(tokenStr string) error {
return nil
}

var bearerRegexp = regexp.MustCompile("^Bearer:[ ]+")
var bearerRegexp = regexp.MustCompile("^Bearer[ ]+")

// verify JWT from event header
// returns true if verified, false otherwise
Expand Down
2 changes: 1 addition & 1 deletion lambda/shared/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestVerifyHeader(t *testing.T) {
event := events.APIGatewayProxyRequest{
MultiValueHeaders: map[string][]string{
"X-Jwt-Authorization": []string{
fmt.Sprintf("Bearer: %s", token),
fmt.Sprintf("Bearer %s", token),
},
},
}
Expand Down

0 comments on commit 2d89883

Please sign in to comment.