mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06: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):
|
||||
|
||||
auth = "MediaBrowser "
|
||||
auth += "Client=%s, " % self.config['app.name']
|
||||
auth += "Device=%s, " % self.config['app.device_name']
|
||||
auth += "DeviceId=%s, " % self.config['app.device_id']
|
||||
auth += "Version=%s" % self.config['app.version']
|
||||
auth += "Client=%s, " % self.config['app.name'].encode('utf-8')
|
||||
auth += "Device=%s, " % self.config['app.device_name'].encode('utf-8')
|
||||
auth += "DeviceId=%s, " % self.config['app.device_id'].encode('utf-8')
|
||||
auth += "Version=%s" % self.config['app.version'].encode('utf-8')
|
||||
|
||||
data['headers'].update({'Authorization': auth})
|
||||
|
||||
if self.config['auth.token']:
|
||||
|
||||
auth += ', UserId=%s' % self.config['auth.user_id']
|
||||
data['headers'].update({'Authorization': auth, 'X-MediaBrowser-Token': self.config['auth.token']})
|
||||
auth += ', UserId=%s' % self.config['auth.user_id'].encode('utf-8')
|
||||
data['headers'].update({'Authorization': auth, 'X-MediaBrowser-Token': self.config['auth.token'].encode('utf-8')})
|
||||
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in a new issue