Decode user/pass using in HTTP Basic Auth
This is a silly fix, which should evolve into one taking into
account RFC7617.
Ref
@@ -79,7 +79,9 @@ def basic_auth(realm, checkpassword, debug=False):
with cherrypy.HTTPError.handle((ValueError, binascii.Error), 400, msg):
scheme, params = auth_header.split(' ', 1)
if scheme.lower() == 'basic':
- username, password = base64_decode(params).split(':', 1)
+ decoded_params = base64_decode(params)
+ decoded_params = tonative(ntob(decoded_params), 'utf-8')
+ username, password = decoded_params.split(':', 1)
if checkpassword(realm, username, password):
if debug:
cherrypy.log('Auth succeeded', 'TOOLS.AUTH_BASIC')
