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_leadinginstead ofString.replacefor getting WebSocket streaming API URL. -
Extract the login responsible for obtaining WebSocket URL into the corresponding
Endpointfunction.
Edited by Eugenij