changeset 8165:b4095011433d

py3: fix auth_crowd str/bytes handling
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 04 Feb 2020 03:25:17 +0100
parents c59e914c4887
children a280c27b3c21
files kallithea/lib/auth_modules/auth_crowd.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/auth_modules/auth_crowd.py	Mon Feb 03 16:08:50 2020 +0100
+++ b/kallithea/lib/auth_modules/auth_crowd.py	Tue Feb 04 03:25:17 2020 +0100
@@ -32,7 +32,7 @@
 
 from kallithea.lib import auth_modules, ext_json
 from kallithea.lib.compat import formatted_json, hybrid_property
-from kallithea.lib.utils2 import ascii_bytes
+from kallithea.lib.utils2 import ascii_bytes, ascii_str, safe_bytes
 
 
 log = logging.getLogger(__name__)
@@ -83,7 +83,7 @@
         _headers = {"Content-type": "application/json",
                     "Accept": "application/json"}
         if self.user and self.passwd:
-            authstring = base64.b64encode("%s:%s" % (self.user, self.passwd))
+            authstring = ascii_str(base64.b64encode(safe_bytes("%s:%s" % (self.user, self.passwd))))
             _headers["Authorization"] = "Basic %s" % authstring
         if headers:
             _headers.update(headers)