Only set authorization header if access_token is present

pull/170/head
Tobias Bradtke 2019-05-12 02:13:57 +02:00 zatwierdzone przez GitHub
rodzic b7fb2d69e6
commit 63975a07ad
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -2849,7 +2849,7 @@ class Mastodon:
# Connect function (called and then potentially passed to async handler)
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,
timeout=(self.request_timeout, timeout))