From f00958f4a262c549e5ff0cda3e8a71d2bfa10dad Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Fri, 1 Mar 2019 14:33:58 +1000 Subject: [PATCH] pybind/mgr/restful: Decode the output of b64decode Need to decode the b64decode output before calling split. b64decode("YWRtaW46NzYxMmJlMTEtYjJmZS00NTA5LTlhY2ItMjYzZGQwZjJmMjUx") b'admin:7612be11-b2fe-4509-9acb-263dd0f2f251' b64decode("YWRtaW46NzYxMmJlMTEtYjJmZS00NTA5LTlhY2ItMjYzZGQwZjJmMjUx").decode() 'admin:7612be11-b2fe-4509-9acb-263dd0f2f251' Fixes: http://tracker.ceph.com/issues/38522 Signed-off-by: Brad Hubbard --- src/pybind/mgr/restful/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/restful/decorators.py b/src/pybind/mgr/restful/decorators.py index 03a9448298c..abf36e339ab 100644 --- a/src/pybind/mgr/restful/decorators.py +++ b/src/pybind/mgr/restful/decorators.py @@ -18,7 +18,7 @@ def auth(f): response.headers['WWW-Authenticate'] = 'Basic realm="Login Required"' return {'message': 'auth: No HTTP username/password'} - username, password = b64decode(request.authorization[1]).split(':') + username, password = b64decode(request.authorization[1]).decode('utf-8').split(':') # Check that the username exists if username not in context.instance.keys: -- 2.47.3