aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Bradtke <[email protected]>2019-05-12 02:13:57 +0200
committerGitHub <[email protected]>2019-05-12 02:13:57 +0200
commit63975a07ad84b76bfc793a82d3da13ca9180684f (patch)
treec1bed4addae6c007d0e5f99c85e1879b0df2d312
parentb7fb2d69e68a58971f9e6a86cefd34e8d8db0779 (diff)
downloadmastodon.py-63975a07ad84b76bfc793a82d3da13ca9180684f.tar.gz
Only set authorization header if access_token is present
-rw-r--r--mastodon/Mastodon.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 4373acd..9aa5320 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -2849,7 +2849,7 @@ class Mastodon:
2849 2849
2850 # Connect function (called and then potentially passed to async handler) 2850 # Connect function (called and then potentially passed to async handler)
2851 def connect_func(): 2851 def connect_func():
2852 headers = {"Authorization": "Bearer " + self.access_token} 2852 headers = {"Authorization": "Bearer " + self.access_token} if self.access_token else {}
2853 connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True, 2853 connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True,
2854 timeout=(self.request_timeout, timeout)) 2854 timeout=(self.request_timeout, timeout))
2855 2855
Powered by cgit v1.2.3 (git 2.41.0)