Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mastodon/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ def __get_streaming_base(self) -> str:
if not streaming_api_url is None and streaming_api_url != self.api_base_url:
# This is probably a websockets URL, which is really for the browser, but requests can't handle it
# So we do this below to turn it into an HTTPS or HTTP URL
parse = urlparse(instance["urls"]["streaming_api"])
parse = urlparse(streaming_api_url)
if parse.scheme == 'wss':
url = "https://" + parse.netloc
elif parse.scheme == 'ws':
url = "http://" + parse.netloc
else:
raise MastodonAPIError(
f"Could not parse streaming api location returned from server: {instance['urls']['streaming_api']}."
f"Could not parse streaming api location returned from server: {streaming_api_url}."
)
else:
url = self.api_base_url
Expand Down