Merge branch 'fix/replace-ws' into 'develop'

Standardize construction of websocket URL

See merge request pleroma/pleroma!1115
This commit is contained in:
lambda 2019-05-03 11:45:04 +00:00
commit 027ded0df7
2 changed files with 2 additions and 3 deletions

View file

@ -35,7 +35,7 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug do
defp csp_string do defp csp_string do
scheme = Config.get([Pleroma.Web.Endpoint, :url])[:scheme] scheme = Config.get([Pleroma.Web.Endpoint, :url])[:scheme]
static_url = Pleroma.Web.Endpoint.static_url() 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}" connect_src = "connect-src 'self' #{static_url} #{websocket_url}"

View file

@ -1295,8 +1295,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
initial_state = initial_state =
%{ %{
meta: %{ meta: %{
streaming_api_base_url: streaming_api_base_url: Pleroma.Web.Endpoint.websocket_url(),
String.replace(Pleroma.Web.Endpoint.static_url(), "http", "ws"),
access_token: token, access_token: token,
locale: "en", locale: "en",
domain: Pleroma.Web.Endpoint.host(), domain: Pleroma.Web.Endpoint.host(),