Add 'self' to ApplicationController CSP

This fixes the welcome page (and presumably other internal rails pages)
giving a Content-Security-Policy error whenever rack-mini-profiler tries
to load – which is enabled by default for new projects
This commit is contained in:
Luke Lau 2021-06-05 01:39:36 +01:00
parent df7057657e
commit 928b3f4f0a
1 changed files with 2 additions and 2 deletions

View File

@ -7,8 +7,8 @@ class Rails::ApplicationController < ActionController::Base # :nodoc:
before_action :disable_content_security_policy_nonce!
content_security_policy do |policy|
policy.script_src :unsafe_inline
policy.style_src :unsafe_inline
policy.script_src :self, :unsafe_inline
policy.style_src :self, :unsafe_inline
end
private