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
1 changed files with 1 additions and 1 deletions

View File

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