mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-19 16:10:59 +00:00
Merge branch 'fix/csp-mediaproxy-base-url' into 'develop'
HTTP security plug: add media proxy base url host to csp See merge request pleroma/pleroma!2638
This commit is contained in:
parent
cd2df734dd
commit
90676bdfe3
1 changed files with 5 additions and 0 deletions
|
@ -113,6 +113,10 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug do
|
||||||
add_source(acc, host)
|
add_source(acc, host)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
media_proxy_base_url =
|
||||||
|
if Config.get([:media_proxy, :base_url]),
|
||||||
|
do: URI.parse(Config.get([:media_proxy, :base_url])).host
|
||||||
|
|
||||||
upload_base_url =
|
upload_base_url =
|
||||||
if Config.get([Pleroma.Upload, :base_url]),
|
if Config.get([Pleroma.Upload, :base_url]),
|
||||||
do: URI.parse(Config.get([Pleroma.Upload, :base_url])).host
|
do: URI.parse(Config.get([Pleroma.Upload, :base_url])).host
|
||||||
|
@ -122,6 +126,7 @@ defmodule Pleroma.Plugs.HTTPSecurityPlug do
|
||||||
do: URI.parse(Config.get([Pleroma.Uploaders.S3, :public_endpoint])).host
|
do: URI.parse(Config.get([Pleroma.Uploaders.S3, :public_endpoint])).host
|
||||||
|
|
||||||
[]
|
[]
|
||||||
|
|> add_source(media_proxy_base_url)
|
||||||
|> add_source(upload_base_url)
|
|> add_source(upload_base_url)
|
||||||
|> add_source(s3_endpoint)
|
|> add_source(s3_endpoint)
|
||||||
|> add_source(media_proxy_whitelist)
|
|> add_source(media_proxy_whitelist)
|
||||||
|
|
Loading…
Reference in a new issue