Skip to content

Commit

Permalink
fix: accept lower and uppercase in bearer token handler
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 22, 2021
1 parent d2ad33c commit 6e46d4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/bearer.go
Expand Up @@ -59,7 +59,7 @@ func BearerTokenFromRequest(r *http.Request, tokenLocation *BearerTokenLocation)
func DefaultBearerTokenFromRequest(r *http.Request) string {
token := r.Header.Get(defaultAuthorizationHeader)
split := strings.SplitN(token, " ", 2)
if len(split) != 2 || !strings.EqualFold(split[0], "bearer") {
if len(split) != 2 || !strings.EqualFold(strings.ToLower(split[0]), "bearer") {
return ""
}
return split[1]
Expand Down

0 comments on commit 6e46d4a

Please sign in to comment.