diff options
author | Lorenz Diener <[email protected]> | 2019-05-31 13:11:47 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2019-05-31 13:11:47 +0200 |
commit | 27075591b5a4361c41ea32284fb74483c0952f61 (patch) | |
tree | 1400a5d380d598fcf8b25f7d556a8bbb9601b029 /mastodon | |
parent | 274bba903acc5b87d1178797d1c921050aab4e7b (diff) | |
parent | 63975a07ad84b76bfc793a82d3da13ca9180684f (diff) | |
download | mastodon.py-27075591b5a4361c41ea32284fb74483c0952f61.tar.gz |
Merge pull request #170 from webwurst/patch-1
Only set authorization header if access_token is present
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 2 |
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 | ||