aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Myers <[email protected]>2017-08-19 05:49:08 -0500
committerElizabeth Myers <[email protected]>2017-08-19 05:49:08 -0500
commita76eafbd46bc51f5306d7baab123597fca1de66d (patch)
treeb8bf47e5908b1761a1b2adde444c7ad411618891 /mastodon
parentfccc4e19866442c609ddddf9d112c6c14ab20d1e (diff)
downloadmastodon.py-a76eafbd46bc51f5306d7baab123597fca1de66d.tar.gz
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.
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py3
1 files changed, 3 insertions, 0 deletions
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:
1083 """Internal add-protocol-to-url helper""" 1083 """Internal add-protocol-to-url helper"""
1084 if not base_url.startswith("http://") and not base_url.startswith("https://"): 1084 if not base_url.startswith("http://") and not base_url.startswith("https://"):
1085 base_url = "https://" + base_url 1085 base_url = "https://" + base_url
1086
1087 # Some API endpoints can't handle extra /'s in path requests
1088 base_url = base_url.rstrip("/")
1086 return base_url 1089 return base_url
1087 1090
1088## 1091##
Powered by cgit v1.2.3 (git 2.41.0)