in dev, allow dev FE

This commit is contained in:
FloatingGhost 2023-04-14 16:36:40 +01:00
parent 1b2c24a19e
commit a079ec3a3c

View file

@ -8,6 +8,8 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do
require Logger
@mix_env Mix.env()
def init(opts), do: opts
def call(conn, _options) do
@ -115,6 +117,11 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do
font_src = "font-src 'self'"
script_src = "script-src 'self' '#{nonce_tag}' "
script_src = if @mix_env == :dev do
"script-src 'self' 'unsafe-eval' 'unsafe-inline'"
else
script_src
end
report = if report_uri, do: ["report-uri ", report_uri, ";report-to csp-endpoint"]
insecure = if scheme == "https", do: "upgrade-insecure-requests"