Fix CSP for webpack-dev-server

This commit is contained in:
Eric 2020-06-22 17:07:09 -05:00 committed by Eric Schultz
parent c25ecd4caf
commit cde1995a6a

View file

@ -4,7 +4,7 @@
# 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|
Rails.application.config.content_security_policy do |policy|
# policy.default_src :self, :https
# policy.font_src :self, :https, :data
# policy.img_src :self, :https, :data
@ -14,7 +14,9 @@
# # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint"
# end
policy.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development?
end
# If you are using UJS then enable automatic nonce generation
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }