Skip to content
Snippets Groups Projects
Commit acb04306 authored by feld's avatar feld Committed by lain
Browse files

Standardize construction of websocket URL

This follows up on the change made in d747bd98
parent 497d34b8
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ defp headers do
defp csp_string do
scheme = Config.get([Pleroma.Web.Endpoint, :url])[:scheme]
static_url = Pleroma.Web.Endpoint.static_url()
websocket_url = String.replace(static_url, "http", "ws")
websocket_url = Pleroma.Web.Endpoint.websocket_url()
connect_src = "connect-src 'self' #{static_url} #{websocket_url}"
......
......@@ -1295,8 +1295,7 @@ def index(%{assigns: %{user: user}} = conn, _params) do
initial_state =
%{
meta: %{
streaming_api_base_url:
String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws"),
streaming_api_base_url: Pleroma.Web.Endpoint.websocket_url(),
access_token: token,
locale: "en",
domain: Pleroma.Web.Endpoint.host(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment