mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Use utf-8 for header encoding
This commit is contained in:
parent
5cbc798cad
commit
0f1f8be5ce
2 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@ import json
|
|||
import requests
|
||||
|
||||
from helper.utils import settings
|
||||
from helper import LazyLogger, get_filesystem_encoding
|
||||
from helper import LazyLogger
|
||||
from six import ensure_str
|
||||
|
||||
|
||||
|
@ -375,7 +375,7 @@ class API(object):
|
|||
"Accept-Charset": "UTF-8,*",
|
||||
"Accept-encoding": "gzip",
|
||||
"User-Agent": self.config.data['http.user_agent'] or "%s/%s" % (self.config.data['app.name'], self.config.data['app.version']),
|
||||
"x-emby-authorization": ensure_str(auth, get_filesystem_encoding())
|
||||
"x-emby-authorization": ensure_str(auth, 'utf-8')
|
||||
}
|
||||
|
||||
def send_request(self, url, path, method="get", timeout=None, headers=None, data=None):
|
||||
|
|
|
@ -9,7 +9,7 @@ import requests
|
|||
from six import string_types, ensure_str
|
||||
|
||||
from helper.utils import JsonDebugPrinter
|
||||
from helper import LazyLogger, get_filesystem_encoding
|
||||
from helper import LazyLogger
|
||||
|
||||
from .exceptions import HTTPException
|
||||
|
||||
|
@ -216,13 +216,13 @@ class HTTP(object):
|
|||
auth += "DeviceId=%s, " % self.config.data.get('app.device_id', 'Unknown Device id')
|
||||
auth += "Version=%s" % self.config.data.get('app.version', '0.0.0')
|
||||
|
||||
data['headers'].update({'x-emby-authorization': ensure_str(auth, get_filesystem_encoding())})
|
||||
data['headers'].update({'x-emby-authorization': ensure_str(auth, 'utf-8')})
|
||||
|
||||
if self.config.data.get('auth.token') and self.config.data.get('auth.user_id'):
|
||||
|
||||
auth += ', UserId=%s' % self.config.data.get('auth.user_id')
|
||||
data['headers'].update({
|
||||
'x-emby-authorization': ensure_str(auth, get_filesystem_encoding()),
|
||||
'x-emby-authorization': ensure_str(auth, 'utf-8'),
|
||||
'X-MediaBrowser-Token': self.config.data.get('auth.token')})
|
||||
|
||||
return data
|
||||
|
|
Loading…
Reference in a new issue