Skip to content

Commit 30193dc

Browse files
committed
Remove deprecated speaker, vibrate, and vr permissions policy directives
1 parent d088d91 commit 30193dc

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed

actionpack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`.
26

37
*Rafael Mendonça França*

actionpack/lib/action_dispatch/http/permissions_policy.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,6 @@ def initialize_copy(other)
132132
end
133133
end
134134

135-
%w[speaker vibrate vr].each do |directive|
136-
define_method(directive) do |*sources|
137-
ActionDispatch.deprecator.warn(<<~MSG)
138-
The `#{directive}` permissions policy directive is deprecated
139-
and will be removed in Rails 7.2.
140-
141-
There is no browser support for this directive, and no plan
142-
for browser support in the future. You can just remove this
143-
directive from your application.
144-
MSG
145-
146-
if sources.first
147-
@directives[directive] = apply_mappings(sources)
148-
else
149-
@directives.delete(directive)
150-
end
151-
end
152-
end
153-
154135
def build(context = nil)
155136
build_directives(context).compact.join("; ")
156137
end

actionpack/test/dispatch/permissions_policy_test.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ def test_invalid_directive_source
3939

4040
assert_equal "Invalid HTTP permissions policy source: [:non_existent]", exception.message
4141
end
42-
43-
def test_deprecated_directives
44-
assert_deprecated(ActionDispatch.deprecator) { @policy.speaker :self }
45-
assert_deprecated(ActionDispatch.deprecator) { @policy.vibrate :self }
46-
assert_deprecated(ActionDispatch.deprecator) { @policy.vr :self }
47-
48-
assert_not_deprecated(ActionDispatch.deprecator) do
49-
assert_equal "speaker 'self'; vibrate 'self'; vr 'self'", @policy.build
50-
end
51-
end
5242
end
5343

5444
class PermissionsPolicyMiddlewareTest < ActionDispatch::IntegrationTest

guides/source/7_2_release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
5858

5959
* Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`.
6060

61+
* Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives.
62+
6163
### Deprecations
6264

6365
* Deprecate `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.

0 commit comments

Comments
 (0)