encode unicode as basestring before passing to urllib3

This commit is contained in:
Alan Hamlett 2016-03-06 13:00:00 -08:00
parent 4d4baea36e
commit 11e6c94ffa

View file

@ -345,7 +345,7 @@ def send_heartbeat(project=None, branch=None, hostname=None, stats={}, key=None,
'Authorization': auth, 'Authorization': auth,
} }
if hostname: if hostname:
headers['X-Machine-Name'] = u(hostname) headers['X-Machine-Name'] = u(hostname).encode('utf-8')
proxies = {} proxies = {}
if proxy: if proxy:
proxies['https'] = proxy proxies['https'] = proxy