summaryrefslogtreecommitdiff
path: root/python3/httplib2
diff options
context:
space:
mode:
authorJoe Gregorio <joe@bitworking.org>2009-08-04 13:41:44 -0400
committerJoe Gregorio <joe@bitworking.org>2009-08-04 13:41:44 -0400
commit68cd898db171ecdaa8a830e78d792acff11968ec (patch)
tree05754c6fa9409e1319ff1cbf4b9a7f51f59d2cb4 /python3/httplib2
parent891439ef1bc8b2a83538ec3e74be50d806daf9d3 (diff)
downloadhttplib2-68cd898db171ecdaa8a830e78d792acff11968ec.tar.gz
Fixed bug in base64 encoding of long passwords
Diffstat (limited to 'python3/httplib2')
-rwxr-xr-xpython3/httplib2/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py
index fac2b90..af0821c 100755
--- a/python3/httplib2/__init__.py
+++ b/python3/httplib2/__init__.py
@@ -355,7 +355,7 @@ def _cnonce():
return dig[:16]
def _wsse_username_token(cnonce, iso_now, password):
- return base64.encodebytes(_sha(("%s%s%s" % (cnonce, iso_now, password)).encode('utf-8')).digest()).strip()
+ return base64.b64encode(_sha(("%s%s%s" % (cnonce, iso_now, password)).encode('utf-8')).digest()).strip()
# For credentials we need two things, first
@@ -427,7 +427,7 @@ class BasicAuthentication(Authentication):
def request(self, method, request_uri, headers, content):
"""Modify the request headers to add the appropriate
Authorization header."""
- headers['authorization'] = 'Basic ' + base64.encodebytes(("%s:%s" % self.credentials).encode('utf-8')).strip().decode('utf-8')
+ headers['authorization'] = 'Basic ' + base64.b64encode(("%s:%s" % self.credentials).encode('utf-8')).strip().decode('utf-8')
class DigestAuthentication(Authentication):