|
4 | 4 | # For further information see the following documentation
|
5 | 5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
6 | 6 |
|
7 |
| -# Rails.application.config.content_security_policy do |policy| |
8 |
| -# policy.default_src :self, :https |
9 |
| -# policy.font_src :self, :https, :data |
10 |
| -# policy.img_src :self, :https, :data |
11 |
| -# policy.object_src :none |
12 |
| -# policy.script_src :self, :https |
13 |
| -# policy.style_src :self, :https |
14 |
| -# # Specify URI for violation reports |
15 |
| -# # policy.report_uri "/csp-violation-report-endpoint" |
| 7 | +# Rails.application.configure do |
| 8 | +# 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 | +# # Specify URI for violation reports |
| 16 | +# # policy.report_uri "/csp-violation-report-endpoint" |
| 17 | +# end |
| 18 | +# |
| 19 | +# # Generate session nonces for permitted importmap and inline scripts |
| 20 | +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } |
| 21 | +# config.content_security_policy_nonce_directives = %w(script-src) |
| 22 | +# |
| 23 | +# # Report CSP violations to a specified URI. See: |
| 24 | +# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only |
| 25 | +# # config.content_security_policy_report_only = true |
16 | 26 | # end
|
17 |
| - |
18 |
| -# If you are using UJS then enable automatic nonce generation |
19 |
| -# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } |
20 |
| - |
21 |
| -# Set the nonce only to specific directives |
22 |
| -# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) |
23 |
| - |
24 |
| -# Report CSP violations to a specified URI |
25 |
| -# For further information see the following documentation: |
26 |
| -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only |
27 |
| -# Rails.application.config.content_security_policy_report_only = true |
0 commit comments