|
3 | 3 | from xml.etree import ElementTree |
4 | 4 |
|
5 | 5 | import requests |
6 | | -from plexapi import BASE_HEADERS, CONFIG, TIMEOUT, log, logfilter, utils |
| 6 | +from plexapi import CONFIG, TIMEOUT, log, logfilter, utils, reset_base_headers |
7 | 7 | from plexapi.base import PlexObject |
8 | 8 | from plexapi.exceptions import BadRequest, NotFound, Unauthorized, Unsupported |
9 | 9 | from plexapi.playqueue import PlayQueue |
@@ -74,6 +74,8 @@ def __init__(self, server=None, data=None, initpath=None, baseurl=None, |
74 | 74 | self._last_call = 0 |
75 | 75 | self._timeline_cache = [] |
76 | 76 | self._timeline_cache_timestamp = 0 |
| 77 | + self._base_headers = reset_base_headers() |
| 78 | + |
77 | 79 | if not any([data is not None, initpath, baseurl, token]): |
78 | 80 | self._baseurl = CONFIG.get('auth.client_baseurl', 'http://localhost:32433') |
79 | 81 | self._token = logfilter.add_secret(CONFIG.get('auth.client_token')) |
@@ -147,7 +149,7 @@ def _loadData(self, data): |
147 | 149 |
|
148 | 150 | def _headers(self, **kwargs): |
149 | 151 | """ Returns a dict of all default headers for Client requests. """ |
150 | | - headers = BASE_HEADERS |
| 152 | + headers = self._base_headers |
151 | 153 | if self._token: |
152 | 154 | headers['X-Plex-Token'] = self._token |
153 | 155 | headers.update(kwargs) |
|
0 commit comments