Allow for resource providers to register a csp policy

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-11-04 11:50:15 +01:00
parent c1dff8caaa
commit e31433cf83
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -166,8 +166,12 @@ defmodule Mobilizon.Web.Plugs.HTTPSecurityPlug do
global_search_policy = [Keyword.get(GlobalSearch.service().csp(), type, [])]
pictures_policy = [Keyword.get(Pictures.service().csp(), type, [])]
resource_providers = Config.get([Mobilizon.Service.ResourceProviders, :csp_policy, type], [])
Enum.join(
config_policy ++ front_end_analytics_policy ++ global_search_policy ++ pictures_policy,
config_policy ++
front_end_analytics_policy ++
global_search_policy ++ pictures_policy ++ resource_providers,
" "
)
end