content_security_policy.rb 1.1 KB

12345678910111213141516171819202122232425
  1. # Be sure to restart your server when you modify this file.
  2. # Define an application-wide content security policy
  3. # For further information see the following documentation
  4. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  5. # Rails.application.config.content_security_policy do |policy|
  6. # policy.default_src :self, :https
  7. # policy.font_src :self, :https, :data
  8. # policy.img_src :self, :https, :data
  9. # policy.object_src :none
  10. # policy.script_src :self, :https
  11. # policy.style_src :self, :https
  12. # # Specify URI for violation reports
  13. # # policy.report_uri "/csp-violation-report-endpoint"
  14. # end
  15. # If you are using UJS then enable automatic nonce generation
  16. # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
  17. # Report CSP violations to a specified URI
  18. # For further information see the following documentation:
  19. # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
  20. # Rails.application.config.content_security_policy_report_only = true