ascii decode in _refresh_access_token

This commit is contained in:
Ryan 2014-12-22 12:20:47 -08:00 committed by Joona Hoikkala
parent 1737a550d3
commit a3a68be7bc
1 changed files with 2 additions and 2 deletions

View File

@ -218,8 +218,8 @@ class SpotifyOAuth(object):
payload = { 'refresh_token': refresh_token,
'grant_type': 'refresh_token'}
auth_header = base64.b64encode(self.client_id + ':' + self.client_secret)
headers = {'Authorization': 'Basic %s' % auth_header}
auth_header = base64.b64encode(bytes(self.client_id + ':' + self.client_secret, encoding='utf-8'))
headers = {'Authorization': 'Basic %s' % auth_header.decode('ascii')}
response = requests.post(self.OAUTH_TOKEN_URL, data=payload,
headers=headers)