1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-03 14:24:23 +01:00
fab-manager/config/initializers/content_security_policy.rb

21 lines
932 B
Ruby
Raw Normal View History

# 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
end