Changeset - b4095011433d
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-02-04 03:25:17
mads@kiilerich.com
Transplanted from: 06dc45a9a4ab
py3: fix auth_crowd str/bytes handling
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth_modules/auth_crowd.py
Show inline comments
 
@@ -32,7 +32,7 @@ import urllib2
 

	
 
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 @@ class CrowdServer(object):
 
        _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)
0 comments (0 inline, 0 general)