Skip to content

Commit 9162df9

Browse files
Enable Rails 7.1 default for action_dispatch.default_headers (#3796)
# `action_dispatch.default_headers` Second to last Rails 7.1 framework default to enable before version bumping `config.load_defaults 7.0` to `config.load_defaults 7.1`
1 parent 7a8046c commit 9162df9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

config/initializers/new_framework_defaults_7_1.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
# Remove the default X-Download-Options headers since it is used only by Internet Explorer.
2424
# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`.
2525
#++
26-
# TODO: enable this one by itself, after the rest
27-
# Rails.application.config.action_dispatch.default_headers = {
28-
# 'X-Frame-Options' => 'SAMEORIGIN',
29-
# 'X-XSS-Protection' => '0',
30-
# 'X-Content-Type-Options' => 'nosniff',
31-
# 'X-Permitted-Cross-Domain-Policies' => 'none',
32-
# 'Referrer-Policy' => 'strict-origin-when-cross-origin'
33-
# }
26+
Rails.application.config.action_dispatch.default_headers = {
27+
'X-Frame-Options' => 'SAMEORIGIN',
28+
'X-XSS-Protection' => '0',
29+
'X-Content-Type-Options' => 'nosniff',
30+
'X-Permitted-Cross-Domain-Policies' => 'none',
31+
'Referrer-Policy' => 'strict-origin-when-cross-origin'
32+
}
3433

3534
###
3635
# Do not treat an `ActionController::Parameters` instance

0 commit comments

Comments
 (0)