New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a default Content Security Policy (CSP) that is lenient yet secure #24961

wants to merge 1 commit into
base: master
Jump to file or symbol
Failed to load files and symbols.
+3 −1
Diff settings


Just for now

@@ -21,7 +21,9 @@ class Railtie < Rails::Railtie # :nodoc:
config.action_dispatch.default_headers = {
'X-Frame-Options' => 'SAMEORIGIN',
'X-XSS-Protection' => '1; mode=block',
'X-Content-Type-Options' => 'nosniff'
'X-Content-Type-Options' => 'nosniff',
'Content-Security-Policy' =>
"default-src 'self' https:; font-src 'self' https: data:; img-src 'self' https: data:; object-src 'none'; script-src 'self' https:; style-src 'self' https: 'unsafe-inline'"
config.eager_load_namespaces << ActionDispatch
ProTip! Use n and p to navigate between commits in a pull request.