Fix basic_auth with Python 3

`base64.b64decode` returns bytes and thus the separator needs to be a bytes-like object.
This commit is contained in:
Ben Hagen
2018-10-08 15:47:13 +02:00
committed by GitHub
parent 95709e582d
commit a5d7827fc7
+1 -1
View File
@@ -2252,7 +2252,7 @@ class Auth(AuthAPI):
if basic_auth_realm:
raise http_401
return (True, False, False)
(username, sep, password) = base64.b64decode(basic[6:]).partition(':')
(username, sep, password) = base64.b64decode(basic[6:]).partition(b':')
is_valid_user = sep and self.login_bare(username, password)
if not is_valid_user and basic_auth_realm:
raise http_401