comparison config/initializers/content_security_policy.rb @ 467:fd3078b4d355

Update to latest rails
author nanaya <me@nanaya.pro>
date Tue, 22 Oct 2019 16:17:30 +0900
parents 07d6c6639adf
children 6cac8fcf8164
comparison
equal deleted inserted replaced
466:722f4eccd370 467:fd3078b4d355
9 # policy.font_src :self, :https, :data 9 # policy.font_src :self, :https, :data
10 # policy.img_src :self, :https, :data 10 # policy.img_src :self, :https, :data
11 # policy.object_src :none 11 # policy.object_src :none
12 # policy.script_src :self, :https 12 # policy.script_src :self, :https
13 # policy.style_src :self, :https 13 # policy.style_src :self, :https
14 # # If you are using webpack-dev-server then specify webpack-dev-server host
15 # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
14 16
15 # # Specify URI for violation reports 17 # # Specify URI for violation reports
16 # # policy.report_uri "/csp-violation-report-endpoint" 18 # # policy.report_uri "/csp-violation-report-endpoint"
17 # end 19 # end
18 20
19 # If you are using UJS then enable automatic nonce generation 21 # If you are using UJS then enable automatic nonce generation
20 # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 22 # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21 23
24 # Set the nonce only to specific directives
25 # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
26
22 # Report CSP violations to a specified URI 27 # Report CSP violations to a specified URI
23 # For further information see the following documentation: 28 # For further information see the following documentation:
24 # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 29 # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25 # Rails.application.config.content_security_policy_report_only = true 30 # Rails.application.config.content_security_policy_report_only = true