Provide an accept CSP policy for global search pictures

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-08-26 17:18:54 +02:00
parent 8812122168
commit 4db13046b7
4 changed files with 21 additions and 2 deletions

View File

@@ -113,6 +113,16 @@ defmodule Mobilizon.Service.GlobalSearch.SearchMobilizon do
end
end
@impl Provider
@doc """
Returns the CSP configuration for this search provider to work
"""
def csp do
:mobilizon
|> Application.get_env(__MODULE__, [])
|> Keyword.get(:csp_policy, [])
end
defp build_event(data) do
picture =
if data["banner"] do