Accept lowercase "bearer" in Authorization header
We ran into a client that blindly takes the value of token_type, which is lowercase "bearer", and passes that back in the Authorization header. In an earlier PR #99 there seemed to be some support for this change to simply accept "bearer" in addition to "Bearer".
This commit is contained in:
parent
1c31acd525
commit
f1ed3328f8
3 changed files with 16 additions and 3 deletions
|
@ -21,7 +21,7 @@ def extract_access_token(request):
|
|||
"""
|
||||
auth_header = request.META.get('HTTP_AUTHORIZATION', '')
|
||||
|
||||
if re.compile('^Bearer\s{1}.+$').match(auth_header):
|
||||
if re.compile('^[Bb]earer\s{1}.+$').match(auth_header):
|
||||
access_token = auth_header.split()[1]
|
||||
else:
|
||||
access_token = request.GET.get('access_token', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue