mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Fix header for requests
Encode to utf-8 to prevent errors if the device name is non-ascii
This commit is contained in:
parent
e7f77d52aa
commit
8283204201
1 changed files with 6 additions and 6 deletions
|
@ -215,17 +215,17 @@ class HTTP(object):
|
||||||
def _authorization(self, data):
|
def _authorization(self, data):
|
||||||
|
|
||||||
auth = "MediaBrowser "
|
auth = "MediaBrowser "
|
||||||
auth += "Client=%s, " % self.config['app.name']
|
auth += "Client=%s, " % self.config['app.name'].encode('utf-8')
|
||||||
auth += "Device=%s, " % self.config['app.device_name']
|
auth += "Device=%s, " % self.config['app.device_name'].encode('utf-8')
|
||||||
auth += "DeviceId=%s, " % self.config['app.device_id']
|
auth += "DeviceId=%s, " % self.config['app.device_id'].encode('utf-8')
|
||||||
auth += "Version=%s" % self.config['app.version']
|
auth += "Version=%s" % self.config['app.version'].encode('utf-8')
|
||||||
|
|
||||||
data['headers'].update({'Authorization': auth})
|
data['headers'].update({'Authorization': auth})
|
||||||
|
|
||||||
if self.config['auth.token']:
|
if self.config['auth.token']:
|
||||||
|
|
||||||
auth += ', UserId=%s' % self.config['auth.user_id']
|
auth += ', UserId=%s' % self.config['auth.user_id'].encode('utf-8')
|
||||||
data['headers'].update({'Authorization': auth, 'X-MediaBrowser-Token': self.config['auth.token']})
|
data['headers'].update({'Authorization': auth, 'X-MediaBrowser-Token': self.config['auth.token'].encode('utf-8')})
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue