Skip to content

Commit 861fc49

Browse files
committed
Allow setting POST headers
1 parent 12fd4a5 commit 861fc49

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

plexauth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
class PlexAuth():
1515

16-
def __init__(self, payload, session=None):
16+
def __init__(self, payload, session=None, headers=None):
1717
'''Create PlexAuth instance.'''
1818
self.client_identifier = str(uuid.uuid4())
1919
self._code = None
20+
self._headers = headers
2021
self._identifier = None
2122
self._payload = payload
2223
self._payload['X-Plex-Client-Identifier'] = self.client_identifier
@@ -29,7 +30,7 @@ def __init__(self, payload, session=None):
2930

3031
async def initiate_auth(self):
3132
'''Request codes needed to create an auth URL. Starts external timeout.'''
32-
async with self._session.post(CODES_URL, data=self._payload) as resp:
33+
async with self._session.post(CODES_URL, data=self._payload, headers=self._headers) as resp:
3334
response = await resp.json()
3435
self._code = response['code']
3536
self._identifier = response['id']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
with open('README.md') as f:
44
long_description = f.read()
55

6-
VERSION="0.0.5"
6+
VERSION="0.0.6"
77

88
setup(
99
name='plexauth',

0 commit comments

Comments
 (0)