DEV: Whitelist CarbonAds URLs on CSP
This commit is contained in:
parent
0980914d0c
commit
40c0af2177
13
plugin.rb
13
plugin.rb
|
@ -21,4 +21,17 @@ after_initialize do
|
|||
Discourse::Application.routes.append do
|
||||
get '/ads.txt' => "adstxt#index"
|
||||
end
|
||||
|
||||
if !SiteSetting.content_security_policy_script_src.split('|'.freeze).include?("http://cdn.carbonads.com")
|
||||
SiteSetting.content_security_policy_script_src = SiteSetting.content_security_policy_script_src+'|http://cdn.carbonads.com'
|
||||
end
|
||||
if !SiteSetting.content_security_policy_script_src.split('|'.freeze).include?("https://cdn.carbonads.com")
|
||||
SiteSetting.content_security_policy_script_src = SiteSetting.content_security_policy_script_src+'|https://cdn.carbonads.com'
|
||||
end
|
||||
if !SiteSetting.content_security_policy_script_src.split('|'.freeze).include?("http://srv.carbonads.net")
|
||||
SiteSetting.content_security_policy_script_src = SiteSetting.content_security_policy_script_src+'|http://srv.carbonads.net'
|
||||
end
|
||||
if !SiteSetting.content_security_policy_script_src.split('|'.freeze).include?("https://srv.carbonads.net")
|
||||
SiteSetting.content_security_policy_script_src = SiteSetting.content_security_policy_script_src+'|https://srv.carbonads.net'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue