Skip to content
Permalink
Browse files

Remove feature policy initializer in API only apps

  • Loading branch information...
y-yagi committed Aug 8, 2019
1 parent 646dd8c commit 6170a2a50226ee9bac7947a34c8e1d077d79e73d
@@ -125,6 +125,7 @@ def config_when_updating
rack_cors_config_exist = File.exist?("config/initializers/cors.rb")
assets_config_exist = File.exist?("config/initializers/assets.rb")
csp_config_exist = File.exist?("config/initializers/content_security_policy.rb")
feature_policy_config_exist = File.exist?("config/initializers/feature_policy.rb")

@config_target_version = Rails.application.config.loaded_config_version || "5.0"

@@ -158,6 +159,10 @@ def config_when_updating
unless csp_config_exist
remove_file "config/initializers/content_security_policy.rb"
end

unless feature_policy_config_exist
remove_file "config/initializers/feature_policy.rb"
end
end
end

@@ -459,6 +464,7 @@ def delete_non_api_initializers_if_api_option
if options[:api]
remove_file "config/initializers/cookies_serializer.rb"
remove_file "config/initializers/content_security_policy.rb"
remove_file "config/initializers/feature_policy.rb"
end
end

@@ -96,6 +96,7 @@ def test_app_update_does_not_generate_unnecessary_config_files
assert_no_file "config/initializers/cookies_serializer.rb"
assert_no_file "config/initializers/assets.rb"
assert_no_file "config/initializers/content_security_policy.rb"
assert_no_file "config/initializers/feature_policy.rb"
end

def test_app_update_does_not_generate_unnecessary_bin_files
@@ -171,6 +172,7 @@ def skipped_files
config/initializers/assets.rb
config/initializers/cookies_serializer.rb
config/initializers/content_security_policy.rb
config/initializers/feature_policy.rb
lib/assets
test/helpers
tmp/cache/assets

0 comments on commit 6170a2a

Please sign in to comment.
You can’t perform that action at this time.