We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Bearer
1 parent 937ae21 commit 6aa1da2Copy full SHA for 6aa1da2
oauth2_provider/middleware.py
@@ -52,8 +52,8 @@ def __init__(self, get_response):
52
53
def __call__(self, request):
54
authheader = request.META.get("HTTP_AUTHORIZATION", "")
55
- if authheader.startswith("Bearer"):
56
- tokenstring = authheader.split()[1]
+ if authheader.startswith("Bearer") and len(authheader.split(maxsplit=1)) == 2:
+ tokenstring = authheader.split(maxsplit=1)[1]
57
AccessToken = get_access_token_model()
58
try:
59
token_checksum = hashlib.sha256(tokenstring.encode("utf-8")).hexdigest()
0 commit comments