diff options
author | ume <bungoume@gmail.com> | 2019-05-01 00:18:08 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 00:18:08 +0900 |
commit | b714c05bcec2e254bbe07298f03f3def7de9179b (patch) | |
tree | 32a3a5181622a49fdc6319d736ab8e4a32852692 | |
parent | 30321dd3c0ca784d3508a1970cf90d9f76835c79 (diff) | |
download | oauthlib-b714c05bcec2e254bbe07298f03f3def7de9179b.tar.gz |
token_type should be case insensitive
-rw-r--r-- | oauthlib/oauth2/rfc6749/tokens.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/oauthlib/oauth2/rfc6749/tokens.py b/oauthlib/oauth2/rfc6749/tokens.py index 7973923..3587af4 100644 --- a/oauthlib/oauth2/rfc6749/tokens.py +++ b/oauthlib/oauth2/rfc6749/tokens.py @@ -254,7 +254,7 @@ def get_token_from_header(request): if 'Authorization' in request.headers: split_header = request.headers.get('Authorization').split() - if len(split_header) == 2 and split_header[0] == 'Bearer': + if len(split_header) == 2 and split_header[0].lower() == 'bearer': token = split_header[1] else: token = request.access_token @@ -353,7 +353,7 @@ class BearerToken(TokenBase): :param request: OAuthlib request. :type request: oauthlib.common.Request """ - if request.headers.get('Authorization', '').split(' ')[0] == 'Bearer': + if request.headers.get('Authorization', '').split(' ')[0].lower() == 'bearer': return 9 elif request.access_token is not None: return 5 |