summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/tokens.py
diff options
context:
space:
mode:
authorJonathan Huot <JonathanHuot@users.noreply.github.com>2019-05-07 13:36:32 +0200
committerGitHub <noreply@github.com>2019-05-07 13:36:32 +0200
commitb6b4d9fa68afa7a588015722f4d3d359b3a86b1f (patch)
treefe21a30b224e858aa285a67f8243ba305275e591 /oauthlib/oauth2/rfc6749/tokens.py
parent754b003514eaac50ac30f207bac692c39c6a94c6 (diff)
parentd436c5aeb142f2d702c99d74d4218830ece6e3c4 (diff)
downloadoauthlib-b6b4d9fa68afa7a588015722f4d3d359b3a86b1f.tar.gz
Merge pull request #674 from bungoume/patch-1
token_type should be case insensitive
Diffstat (limited to 'oauthlib/oauth2/rfc6749/tokens.py')
-rw-r--r--oauthlib/oauth2/rfc6749/tokens.py4
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