2022-03-09 16:31:38 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-31 11:28:00 +02:00
|
|
|
# Be sure to restart your server when you modify this file.
|
|
|
|
|
2023-03-28 12:44:00 +02:00
|
|
|
# Define an application-wide content security policy.
|
|
|
|
# See the Securing Rails Applications Guide for more information:
|
|
|
|
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
2020-03-31 11:28:00 +02:00
|
|
|
|
2023-03-28 12:44:00 +02:00
|
|
|
Rails.application.configure do
|
|
|
|
config.content_security_policy do |policy|
|
|
|
|
# If you are using webpack-dev-server then specify webpack-dev-server host
|
|
|
|
policy.connect_src :self, :https, :wss, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
|
|
|
|
end
|
|
|
|
# # Generate session nonces for permitted importmap and inline scripts
|
|
|
|
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
|
|
|
# config.content_security_policy_nonce_directives = %w(script-src)
|
|
|
|
#
|
|
|
|
# # Report violations without enforcing the policy.
|
|
|
|
# # config.content_security_policy_report_only = true
|
2022-03-09 16:31:38 +01:00
|
|
|
end
|