diff --git a/config/application.rb b/config/application.rb index d23d53b3..0293da3c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -66,10 +66,5 @@ class Application < Rails::Application config.developer_mode_enabled = ENV.fetch('DEVELOPER_MODE_ENABLED', 'false').casecmp?('true') config.generators.javascript_engine = :js - - # Allow this to work in an iframe on another domain - config.action_dispatch.default_headers = { - 'X-Frame-Options' => 'ALLOWALL', - } end end diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 8eb1d613..f2c788b9 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -19,22 +19,23 @@ # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy -# Rails.application.config.content_security_policy do |policy| # # If you are using webpack-dev-server then specify webpack-dev-server host -# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? +Rails.application.config.content_security_policy do |policy| # # If you are using webpack-dev-server then specify webpack-dev-server host + # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? -# 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 + # 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 + policy.frame_ancestors('*') -# # Specify URI for violation reports -# # policy.report_uri "/csp-violation-report-endpoint" -# end + # Specify URI for violation reports + # policy.report_uri "/csp-violation-report-endpoint" +end # If you are using UJS then enable automatic nonce generation -# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } +Rails.application.config.content_security_policy_nonce_generator = ->(_request) { SecureRandom.base64(16) } # Report CSP violations to a specified URI # For further information see the following documentation: