about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-02-06 11:25:18 +0100
committerThibG <thib@sitedethib.com>2020-02-06 12:15:15 +0100
commitccaefd139d33f2f0bf4d097131bcf91960bee956 (patch)
treeea2b5449eb0d697844d5ace1e68d5eaaa6bea1f1 /config
parent885e9227c6e8e1ce5e4a5625d5126ba76dce2c00 (diff)
Add environment variable to specify extra data hosts
Fixes #1276
Diffstat (limited to 'config')
-rw-r--r--config/initializers/content_security_policy.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index 810aa2880..269a7d1c9 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -23,6 +23,8 @@ if Rails.env.production?
     data_hosts << "https://#{url.host}"
   end
 
+  data_hosts.concat(ENV['EXTRA_DATA_HOSTS'].split('|')) if ENV['EXTRA_DATA_HOSTS']
+
   data_hosts.uniq!
 
   Rails.application.config.content_security_policy do |p|