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