Closed SufyanIqbal1622 closed 3 years ago
Running into this on fresh rails projects. Also looking for a solution.
I'm not familiar with content security policies, but setting them up like this made it work for me with a fresh rails project:
Rails.application.config.content_security_policy do |policy|
# These are some sane defaults
policy.default_src :self, :https
policy.font_src :self, :https, :data
policy.img_src :self, :https, :data
policy.object_src :none
policy.script_src :self, :https
policy.style_src :self, :https
# This fixes rack mini profiler
policy.script_src_elem :self, :unsafe_inline if Rails.env.development?
policy.style_src_elem :self, :unsafe_inline if Rails.env.development?
policy.connect_src *policy.connect_src, :self if Rails.env.development?
end
They can be found in config/initializers/content_security_policy.rb
That did the trick, thanks @CalvinWalzel
Thanks @CalvinWalzel
Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:3000/mini-profiler-resources/includes.js?v=644e88e41aaa4b3ea7e36f7c445b7bfd (“script-src”).![image](https://user-images.githubusercontent.com/44440200/110154530-2d4f3000-7e06-11eb-81d2-22942d0b532a.png)