Fix WebSocket streaming API URL.
Small fix:
Current String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws"
replaces all http
occurrences in the string (which in a rare case can be present in a domain name)
-
Use
String.replace_leading
instead ofString.replace
for getting WebSocket streaming API URL. -
Extract the login responsible for obtaining WebSocket URL into the corresponding
Endpoint
function.
Edited by Eugenij