From a76eafbd46bc51f5306d7baab123597fca1de66d Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Sat, 19 Aug 2017 05:49:08 -0500 Subject: Remove trailing slashes in base URL The streaming API can't handle multiple slashes in the lead of a path request. This is probably a bug in Mastodon, but should be worked around here for now. --- mastodon/Mastodon.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 8aa741a..4012945 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1083,6 +1083,9 @@ class Mastodon: """Internal add-protocol-to-url helper""" if not base_url.startswith("http://") and not base_url.startswith("https://"): base_url = "https://" + base_url + + # Some API endpoints can't handle extra /'s in path requests + base_url = base_url.rstrip("/") return base_url ## -- cgit v1.2.3