Fix http(s)_request in dogtag. Was blowing up because of unicode strings.

This commit is contained in:
Pavel Zuna authored and Rob Crittenden committed 2010-03-30 15:11:56 -04:00
1 parent 918721c1d0
commit 9dd082eb33
1 file changed
+4
+4
View File
@@ -66,6 +66,8 @@ def https_request(host, port, url, secdir, password, nickname, **kw):
Perform a client authenticated HTTPS request
"""
if isinstance(host, unicode):
host = host.encode('utf-8')
uri = 'https://%s:%d%s' % (host, port, url)
post = urlencode(kw)
logging.info('sslget %r', uri)
@@ -101,6 +103,8 @@ def http_request(host, port, url, **kw):
Perform an HTTP request.
"""
if isinstance(host, unicode):
host = host.encode('utf-8')
uri = 'http://%s:%s%s' % (host, port, url)
post = urlencode(kw)
logging.info('request %r', uri)