|
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 |
@@ -71,6 +71,8 @@ def __init__(self, server=None, data=None, initpath=None, baseurl=None, |
71 | 71 | self._last_call = 0 |
72 | 72 | self._timeline_cache = [] |
73 | 73 | self._timeline_cache_timestamp = 0 |
| 74 | + self._base_headers = reset_base_headers() |
| 75 | + |
74 | 76 | if not any([data is not None, initpath, baseurl, token]): |
75 | 77 | self._baseurl = CONFIG.get('auth.client_baseurl', 'http://localhost:32433') |
76 | 78 | self._token = logfilter.add_secret(CONFIG.get('auth.client_token')) |
@@ -126,7 +128,7 @@ def _loadData(self, data): |
126 | 128 |
|
127 | 129 | def _headers(self, **kwargs): |
128 | 130 | """ Returns a dict of all default headers for Client requests. """ |
129 | | - headers = BASE_HEADERS |
| 131 | + headers = self._base_headers |
130 | 132 | if self._token: |
131 | 133 | headers['X-Plex-Token'] = self._token |
132 | 134 | headers.update(kwargs) |
|
0 commit comments