Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change server identification header to allow for basic auth support #52 #56

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions resources/lib/jellyfin/core/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _get_header(self, data):
'User-Agent': self.config['http.user_agent'] or "%s/%s" % (self.config['app.name'], self.config['app.version'])
})

if 'Authorization' not in data['headers']:
if 'x-emby-authorization' not in data['headers']:
self._authorization(data)

return data
Expand All @@ -222,12 +222,12 @@ def _authorization(self, data):
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})
data['headers'].update({'x-emby-authorization': auth})

if self.config['auth.token'] and 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'].encode('utf-8')})
data['headers'].update({'x-emby-authorization': auth, 'X-MediaBrowser-Token': self.config['auth.token'].encode('utf-8')})

return data

Expand Down