about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-10-12 19:07:30 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-10-12 19:07:30 +0200
commit8ab081ec3245e70acb7878b7842cfa07ca050464 (patch)
tree8ce3b67ba604740693821583178e8c4f7b944c25 /config/initializers
parent9d4541c612b506889675c4c19ced5cd17ad3710f (diff)
Add manifest_src to CSP, add blob to connect_src (#8967)
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/content_security_policy.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index 962b871a2..59cfbba17 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -15,14 +15,15 @@ Rails.application.config.content_security_policy do |p|
   p.style_src       :self, :unsafe_inline, assets_host
   p.media_src       :self, :https, :data, assets_host
   p.frame_src       :self, :https
+  p.manifest_src    :self, assets_host
 
   if Rails.env.development?
     webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{Webpacker.dev_server.host_with_port}" }
 
-    p.connect_src :self, assets_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls
+    p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls
     p.script_src  :self, :unsafe_inline, :unsafe_eval, assets_host
   else
-    p.connect_src :self, assets_host, Rails.configuration.x.streaming_api_base_url
+    p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url
     p.script_src  :self, assets_host
   end
 end