diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index b03dfc591cbbc..a449bd42cb7f4 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives. + + *Rafael Mendonça França* + * Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`. *Rafael Mendonça França* diff --git a/actionpack/lib/action_dispatch/http/permissions_policy.rb b/actionpack/lib/action_dispatch/http/permissions_policy.rb index 45ed9e4d6c5ba..89ec3141a85c4 100644 --- a/actionpack/lib/action_dispatch/http/permissions_policy.rb +++ b/actionpack/lib/action_dispatch/http/permissions_policy.rb @@ -132,25 +132,6 @@ def initialize_copy(other) end end - %w[speaker vibrate vr].each do |directive| - define_method(directive) do |*sources| - ActionDispatch.deprecator.warn(<<~MSG) - The `#{directive}` permissions policy directive is deprecated - and will be removed in Rails 7.2. - - There is no browser support for this directive, and no plan - for browser support in the future. You can just remove this - directive from your application. - MSG - - if sources.first - @directives[directive] = apply_mappings(sources) - else - @directives.delete(directive) - end - end - end - def build(context = nil) build_directives(context).compact.join("; ") end diff --git a/actionpack/test/dispatch/permissions_policy_test.rb b/actionpack/test/dispatch/permissions_policy_test.rb index c98f06b7dd543..9239b12f6b99d 100644 --- a/actionpack/test/dispatch/permissions_policy_test.rb +++ b/actionpack/test/dispatch/permissions_policy_test.rb @@ -39,16 +39,6 @@ def test_invalid_directive_source assert_equal "Invalid HTTP permissions policy source: [:non_existent]", exception.message end - - def test_deprecated_directives - assert_deprecated(ActionDispatch.deprecator) { @policy.speaker :self } - assert_deprecated(ActionDispatch.deprecator) { @policy.vibrate :self } - assert_deprecated(ActionDispatch.deprecator) { @policy.vr :self } - - assert_not_deprecated(ActionDispatch.deprecator) do - assert_equal "speaker 'self'; vibrate 'self'; vr 'self'", @policy.build - end - end end class PermissionsPolicyMiddlewareTest < ActionDispatch::IntegrationTest diff --git a/guides/source/7_2_release_notes.md b/guides/source/7_2_release_notes.md index 075eb32281314..132992d5fffcd 100644 --- a/guides/source/7_2_release_notes.md +++ b/guides/source/7_2_release_notes.md @@ -58,6 +58,8 @@ Please refer to the [Changelog][action-pack] for detailed changes. * Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`. +* Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives. + ### Deprecations * Deprecate `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.