HTTPSecurityPlug: Fix tests
This commit is contained in:
parent
c67b41415b
commit
81e44ced0c
|
@ -154,7 +154,7 @@
|
|||
config :pleroma, Pleroma.ScheduledActivity, config_impl: Pleroma.UnstubbedConfigMock
|
||||
config :pleroma, Pleroma.Web.RichMedia.Helpers, config_impl: Pleroma.StaticStubbedConfigMock
|
||||
config :pleroma, Pleroma.Uploaders.IPFS, config_impl: Pleroma.UnstubbedConfigMock
|
||||
config :pleroma, Pleroma.Web.Plugs.HTTPSecurityPlug, config_impl: Pleroma.UnstubbedConfigMock
|
||||
config :pleroma, Pleroma.Web.Plugs.HTTPSecurityPlug, config_impl: Pleroma.StaticStubbedConfigMock
|
||||
|
||||
peer_module =
|
||||
if String.to_integer(System.otp_release()) >= 25 do
|
||||
|
|
|
@ -116,7 +116,7 @@ defp csp_string do
|
|||
end
|
||||
|
||||
connect_src =
|
||||
if @config_impl.get(:env) == :dev do
|
||||
if @config_impl.get([:env]) == :dev do
|
||||
[connect_src, " http://localhost:3035/"]
|
||||
else
|
||||
connect_src
|
||||
|
@ -124,7 +124,7 @@ defp csp_string do
|
|||
|
||||
script_src =
|
||||
if @config_impl.get([:http_security, :allow_unsafe_eval]) do
|
||||
if @config_impl.get(:env) == :dev do
|
||||
if @config_impl.get([:env]) == :dev do
|
||||
"script-src 'self' 'unsafe-eval'"
|
||||
else
|
||||
"script-src 'self' 'wasm-unsafe-eval'"
|
||||
|
|
|
@ -15,7 +15,7 @@ defmodule Pleroma.Web.Plugs.HTTPSecurityPlugTest do
|
|||
end
|
||||
|
||||
defp mock_config(config, additional \\ %{}) do
|
||||
Pleroma.UnstubbedConfigMock
|
||||
Pleroma.StaticStubbedConfigMock
|
||||
|> stub(:get, fn
|
||||
[:http_security, key] -> config[key]
|
||||
key -> additional[key]
|
||||
|
|
Loading…
Reference in New Issue