Merge pull request #170 from webwurst/patch-1
Only set authorization header if access_token is present
This commit is contained in:
commit
27075591b5
S'han modificat 1 arxius amb 1 adicions i 1 eliminacions
|
@ -2849,7 +2849,7 @@ class Mastodon:
|
||||||
|
|
||||||
# Connect function (called and then potentially passed to async handler)
|
# Connect function (called and then potentially passed to async handler)
|
||||||
def connect_func():
|
def connect_func():
|
||||||
headers = {"Authorization": "Bearer " + self.access_token}
|
headers = {"Authorization": "Bearer " + self.access_token} if self.access_token else {}
|
||||||
connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True,
|
connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True,
|
||||||
timeout=(self.request_timeout, timeout))
|
timeout=(self.request_timeout, timeout))
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència