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