@@ -86,6 +86,10 @@ class Application < Rails::Application
86
86
87
87
# Disable ActionCable's request forgery protection
88
88
# This is basically matching a set of allowed origins which is not good for us
89
+ # Note, similarly named forgery protections in action controller are set to true
90
+ # https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L115C12-L115C69
91
+ # 5.0 sets: action_controller.forgery_protection_origin_check = true
92
+ # 5.2 sets: action_controller.default_protect_from_forgery = true
89
93
config . action_cable . disable_request_forgery_protection = false
90
94
# Matching the origin against the HOST header is much more convenient
91
95
config . action_cable . allow_same_origin_as_host = true
@@ -106,8 +110,23 @@ class Application < Rails::Application
106
110
107
111
config . autoload_paths += config . eager_load_paths
108
112
109
- # config.load_defaults 6.1
110
- # Disable defaults as ActiveRecord::Base.belongs_to_required_by_default = true causes MiqRegion.seed to fail validation on belongs_to maintenance zone
113
+ # FYI, this is where load_defaults is defined as of 7.2:
114
+ # https://github.com/rails/rails/blob/d437ae311f1b9dc40b442e40eb602e020cec4e49/railties/lib/rails/application/configuration.rb#L92
115
+ config . load_defaults 7.0
116
+
117
+ # TODO: this is the only change we had from defaults in 7.0. See secure_headers.rb. It's 0 in defaults.
118
+ config . action_dispatch . default_headers [ "X-XSS-Protection" ] = "1; mode=block"
119
+
120
+ # TODO: Find and fixed any deprecated behavior. Opt in later.
121
+ config . active_support . remove_deprecated_time_with_zone_name = false
122
+ config . active_support . disable_to_s_conversion = false
123
+
124
+ # TODO: If disabled, causes cross repo test failures in content, ui-classic and amazon provider
125
+ config . active_record . partial_inserts = true
126
+
127
+ # Disable this setting as it causes MiqRegion.seed to fail validation on belongs_to maintenance zone.
128
+ # TODO: We should fix this so we don't need to carry this override.
129
+ config . active_record . belongs_to_required_by_default = false
111
130
112
131
# NOTE: If you are going to make changes to autoload_paths, please make
113
132
# sure they are all strings. Rails will push these paths into the
0 commit comments