Standardize construction of websocket URL

This follows up on the change made in d747bd98
This commit is contained in:
feld 2019-05-03 11:45:04 +00:00 committed by lambda
commit acb04306b6
2 changed files with 2 additions and 3 deletions

View file

@ -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}"