Changeset 2470
- Timestamp:
- 07/04/09 12:31:58
- Files:
-
- branches/python3/cherrypy/lib/auth_basic.py (modified) (1 diff)
- branches/python3/cherrypy/lib/httpauth.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/python3/cherrypy/lib/auth_basic.py
r2461 r2470 72 72 # since CherryPy claims compability with Python 2.3, we must use 73 73 # the legacy API of base64 74 username_password = base64.decode string(bytes(params, "ISO-8859-1"))74 username_password = base64.decodebytes(bytes(params, "ISO-8859-1")) 75 75 username, password = username_password.decode("ISO-8859-1").split(':', 1) 76 76 if checkpassword(realm, username, password): 77 77 request.login = username 78 78 return # successful authentication 79 except (ValueError, binascii.Error): # split() error, base64.decode string() error79 except (ValueError, binascii.Error): # split() error, base64.decodebytes() error 80 80 raise cherrypy.HTTPError(400, 'Bad Request') 81 81 branches/python3/cherrypy/lib/httpauth.py
r2467 r2470 157 157 def _parseBasicAuthorization (auth_params): 158 158 params = auth_params.encode('ascii') 159 params = base64.decode string(params)159 params = base64.decodebytes(params) 160 160 username, password = params.decode('ISO-8859-1').split(":", 1) 161 161 return {"username": username, "password": password}

