logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 027ded0df799266d74d9680bd7ef24450efc910f
parent: 497d34b825bd3600b2067a8c47e29f41234fa315
Author: lambda <lain@soykaf.club>
Date:   Fri,  3 May 2019 11:45:04 +0000

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

Standardize construction of websocket URL

See merge request pleroma/pleroma!1115

Diffstat:

Mlib/pleroma/plugs/http_security_plug.ex2+-
Mlib/pleroma/web/mastodon_api/mastodon_api_controller.ex3+--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/pleroma/plugs/http_security_plug.ex b/lib/pleroma/plugs/http_security_plug.ex @@ -35,7 +35,7 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug 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}" diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -1295,8 +1295,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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(),