actionpack 7.1.3.2 → 7.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +70 -530
  3. data/lib/abstract_controller/asset_paths.rb +2 -0
  4. data/lib/abstract_controller/base.rb +102 -98
  5. data/lib/abstract_controller/caching/fragments.rb +50 -53
  6. data/lib/abstract_controller/caching.rb +2 -0
  7. data/lib/abstract_controller/callbacks.rb +66 -64
  8. data/lib/abstract_controller/collector.rb +6 -6
  9. data/lib/abstract_controller/deprecator.rb +2 -0
  10. data/lib/abstract_controller/error.rb +2 -0
  11. data/lib/abstract_controller/helpers.rb +70 -85
  12. data/lib/abstract_controller/logger.rb +2 -0
  13. data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
  14. data/lib/abstract_controller/rendering.rb +13 -12
  15. data/lib/abstract_controller/translation.rb +11 -10
  16. data/lib/abstract_controller/url_for.rb +8 -6
  17. data/lib/abstract_controller.rb +2 -0
  18. data/lib/action_controller/api/api_rendering.rb +2 -0
  19. data/lib/action_controller/api.rb +74 -72
  20. data/lib/action_controller/base.rb +155 -117
  21. data/lib/action_controller/caching.rb +15 -12
  22. data/lib/action_controller/deprecator.rb +2 -0
  23. data/lib/action_controller/form_builder.rb +20 -17
  24. data/lib/action_controller/log_subscriber.rb +3 -1
  25. data/lib/action_controller/metal/allow_browser.rb +119 -0
  26. data/lib/action_controller/metal/basic_implicit_render.rb +2 -0
  27. data/lib/action_controller/metal/conditional_get.rb +188 -174
  28. data/lib/action_controller/metal/content_security_policy.rb +25 -24
  29. data/lib/action_controller/metal/cookies.rb +4 -2
  30. data/lib/action_controller/metal/data_streaming.rb +64 -55
  31. data/lib/action_controller/metal/default_headers.rb +5 -3
  32. data/lib/action_controller/metal/etag_with_flash.rb +3 -1
  33. data/lib/action_controller/metal/etag_with_template_digest.rb +17 -15
  34. data/lib/action_controller/metal/exceptions.rb +11 -9
  35. data/lib/action_controller/metal/flash.rb +12 -10
  36. data/lib/action_controller/metal/head.rb +12 -10
  37. data/lib/action_controller/metal/helpers.rb +63 -55
  38. data/lib/action_controller/metal/http_authentication.rb +209 -201
  39. data/lib/action_controller/metal/implicit_render.rb +17 -15
  40. data/lib/action_controller/metal/instrumentation.rb +15 -12
  41. data/lib/action_controller/metal/live.rb +113 -107
  42. data/lib/action_controller/metal/logging.rb +6 -4
  43. data/lib/action_controller/metal/mime_responds.rb +151 -142
  44. data/lib/action_controller/metal/parameter_encoding.rb +34 -32
  45. data/lib/action_controller/metal/params_wrapper.rb +57 -59
  46. data/lib/action_controller/metal/permissions_policy.rb +13 -12
  47. data/lib/action_controller/metal/rate_limiting.rb +62 -0
  48. data/lib/action_controller/metal/redirecting.rb +108 -82
  49. data/lib/action_controller/metal/renderers.rb +50 -49
  50. data/lib/action_controller/metal/rendering.rb +103 -75
  51. data/lib/action_controller/metal/request_forgery_protection.rb +162 -133
  52. data/lib/action_controller/metal/rescue.rb +11 -9
  53. data/lib/action_controller/metal/streaming.rb +138 -136
  54. data/lib/action_controller/metal/strong_parameters.rb +525 -480
  55. data/lib/action_controller/metal/testing.rb +2 -0
  56. data/lib/action_controller/metal/url_for.rb +17 -15
  57. data/lib/action_controller/metal.rb +58 -57
  58. data/lib/action_controller/railtie.rb +3 -0
  59. data/lib/action_controller/railties/helpers.rb +2 -0
  60. data/lib/action_controller/renderer.rb +42 -36
  61. data/lib/action_controller/template_assertions.rb +4 -2
  62. data/lib/action_controller/test_case.rb +146 -126
  63. data/lib/action_controller.rb +10 -3
  64. data/lib/action_dispatch/constants.rb +2 -0
  65. data/lib/action_dispatch/deprecator.rb +2 -0
  66. data/lib/action_dispatch/http/cache.rb +27 -26
  67. data/lib/action_dispatch/http/content_disposition.rb +2 -0
  68. data/lib/action_dispatch/http/content_security_policy.rb +44 -38
  69. data/lib/action_dispatch/http/filter_parameters.rb +9 -5
  70. data/lib/action_dispatch/http/filter_redirect.rb +15 -1
  71. data/lib/action_dispatch/http/headers.rb +22 -22
  72. data/lib/action_dispatch/http/mime_negotiation.rb +30 -41
  73. data/lib/action_dispatch/http/mime_type.rb +29 -22
  74. data/lib/action_dispatch/http/mime_types.rb +2 -0
  75. data/lib/action_dispatch/http/parameters.rb +11 -9
  76. data/lib/action_dispatch/http/permissions_policy.rb +20 -37
  77. data/lib/action_dispatch/http/rack_cache.rb +2 -0
  78. data/lib/action_dispatch/http/request.rb +71 -71
  79. data/lib/action_dispatch/http/response.rb +61 -61
  80. data/lib/action_dispatch/http/upload.rb +18 -16
  81. data/lib/action_dispatch/http/url.rb +75 -73
  82. data/lib/action_dispatch/journey/formatter.rb +13 -6
  83. data/lib/action_dispatch/journey/gtg/builder.rb +4 -3
  84. data/lib/action_dispatch/journey/gtg/simulator.rb +2 -0
  85. data/lib/action_dispatch/journey/gtg/transition_table.rb +10 -8
  86. data/lib/action_dispatch/journey/nfa/dot.rb +2 -0
  87. data/lib/action_dispatch/journey/nodes/node.rb +6 -5
  88. data/lib/action_dispatch/journey/parser.rb +4 -3
  89. data/lib/action_dispatch/journey/parser_extras.rb +2 -0
  90. data/lib/action_dispatch/journey/path/pattern.rb +4 -1
  91. data/lib/action_dispatch/journey/route.rb +9 -7
  92. data/lib/action_dispatch/journey/router/utils.rb +16 -15
  93. data/lib/action_dispatch/journey/router.rb +4 -2
  94. data/lib/action_dispatch/journey/routes.rb +4 -2
  95. data/lib/action_dispatch/journey/scanner.rb +4 -2
  96. data/lib/action_dispatch/journey/visitors.rb +2 -0
  97. data/lib/action_dispatch/journey.rb +2 -0
  98. data/lib/action_dispatch/log_subscriber.rb +2 -0
  99. data/lib/action_dispatch/middleware/actionable_exceptions.rb +2 -0
  100. data/lib/action_dispatch/middleware/assume_ssl.rb +8 -5
  101. data/lib/action_dispatch/middleware/callbacks.rb +3 -1
  102. data/lib/action_dispatch/middleware/cookies.rb +119 -104
  103. data/lib/action_dispatch/middleware/debug_exceptions.rb +13 -5
  104. data/lib/action_dispatch/middleware/debug_locks.rb +15 -13
  105. data/lib/action_dispatch/middleware/debug_view.rb +2 -0
  106. data/lib/action_dispatch/middleware/exception_wrapper.rb +6 -11
  107. data/lib/action_dispatch/middleware/executor.rb +8 -0
  108. data/lib/action_dispatch/middleware/flash.rb +63 -51
  109. data/lib/action_dispatch/middleware/host_authorization.rb +17 -15
  110. data/lib/action_dispatch/middleware/public_exceptions.rb +8 -6
  111. data/lib/action_dispatch/middleware/reloader.rb +5 -3
  112. data/lib/action_dispatch/middleware/remote_ip.rb +77 -72
  113. data/lib/action_dispatch/middleware/request_id.rb +14 -9
  114. data/lib/action_dispatch/middleware/server_timing.rb +4 -2
  115. data/lib/action_dispatch/middleware/session/abstract_store.rb +2 -0
  116. data/lib/action_dispatch/middleware/session/cache_store.rb +13 -8
  117. data/lib/action_dispatch/middleware/session/cookie_store.rb +27 -26
  118. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +7 -3
  119. data/lib/action_dispatch/middleware/show_exceptions.rb +31 -21
  120. data/lib/action_dispatch/middleware/ssl.rb +43 -40
  121. data/lib/action_dispatch/middleware/stack.rb +11 -10
  122. data/lib/action_dispatch/middleware/static.rb +33 -31
  123. data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +1 -1
  124. data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +1 -1
  125. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +1 -1
  126. data/lib/action_dispatch/railtie.rb +2 -4
  127. data/lib/action_dispatch/request/session.rb +23 -21
  128. data/lib/action_dispatch/request/utils.rb +2 -0
  129. data/lib/action_dispatch/routing/endpoint.rb +2 -0
  130. data/lib/action_dispatch/routing/inspector.rb +5 -3
  131. data/lib/action_dispatch/routing/mapper.rb +670 -635
  132. data/lib/action_dispatch/routing/polymorphic_routes.rb +69 -62
  133. data/lib/action_dispatch/routing/redirection.rb +37 -32
  134. data/lib/action_dispatch/routing/route_set.rb +59 -45
  135. data/lib/action_dispatch/routing/routes_proxy.rb +6 -4
  136. data/lib/action_dispatch/routing/url_for.rb +130 -125
  137. data/lib/action_dispatch/routing.rb +150 -148
  138. data/lib/action_dispatch/system_test_case.rb +91 -81
  139. data/lib/action_dispatch/system_testing/browser.rb +10 -3
  140. data/lib/action_dispatch/system_testing/driver.rb +3 -1
  141. data/lib/action_dispatch/system_testing/server.rb +2 -0
  142. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +32 -21
  143. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +2 -0
  144. data/lib/action_dispatch/testing/assertion_response.rb +8 -6
  145. data/lib/action_dispatch/testing/assertions/response.rb +26 -23
  146. data/lib/action_dispatch/testing/assertions/routing.rb +153 -84
  147. data/lib/action_dispatch/testing/assertions.rb +2 -0
  148. data/lib/action_dispatch/testing/integration.rb +223 -222
  149. data/lib/action_dispatch/testing/request_encoder.rb +2 -0
  150. data/lib/action_dispatch/testing/test_helpers/page_dump_helper.rb +35 -0
  151. data/lib/action_dispatch/testing/test_process.rb +12 -8
  152. data/lib/action_dispatch/testing/test_request.rb +3 -1
  153. data/lib/action_dispatch/testing/test_response.rb +27 -26
  154. data/lib/action_dispatch.rb +22 -28
  155. data/lib/action_pack/gem_version.rb +6 -4
  156. data/lib/action_pack/version.rb +3 -1
  157. data/lib/action_pack.rb +17 -16
  158. metadata +30 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4292c39dbe982f29c089fbad81538386ac6b1b4dd79f344e3c1ff7374d4e59f3
4
- data.tar.gz: 89469955ba1aaa7c39380024f91094fe396b90171b5ad8a97600954473661a90
3
+ metadata.gz: 0123bbeea23e6d62a0290acc58bad6fbe553c2166462201e5468df2de56a57ac
4
+ data.tar.gz: e9241af2c4cb05c18c6bb5c3bf7da08fa814f592a1ecaace52b925a7a8906780
5
5
  SHA512:
6
- metadata.gz: 2ce33132f475091c9ebd244ef0c84761af9d5b9eedf89069be5ae47d1164277608f29845f8240a002fb8b7f24b70548948a82f390b786f1161d14a55084f6e41
7
- data.tar.gz: 897ca28b4db398d969fa25b5d7a9dc75667eb73c0a94c993732a84b2ddbdaffa0fe12cfa3eab5f8094022d057f2cfb19b3d83716103924c29a5ddc14f9f7f923
6
+ metadata.gz: eb26162552c078839c11acb547fd122c5f8436271305f9372f267532706ab2d5b2862d00055f184f744351fd4ef73f744b173e63d9646af2c56d8f66bdee7454
7
+ data.tar.gz: 411d83ea88d757b9a86002e009d4d243f6cd5ac9dac6929a43324d595a275fa9abcdbbf53d1e291b38a090a9e1d7c39d5a140099012a6268dd681447c7132884
data/CHANGELOG.md CHANGED
@@ -1,598 +1,138 @@
1
- ## Rails 7.1.3.2 (February 21, 2024) ##
1
+ ## Rails 7.2.0.beta1 (May 29, 2024) ##
2
2
 
3
- * Fix `raise_on_missing_translations` not working correctly with the
4
- `translate` method in controllers after the patch for CVE-2024-26143.
3
+ * Fix `Mime::Type.parse` handling type parameters for HTTP Accept headers.
5
4
 
6
- ## Rails 7.1.3.1 (February 21, 2024) ##
5
+ *Taylor Chaparro*
7
6
 
8
- * Fix possible XSS vulnerability with the `translate` method in controllers
7
+ * Fix the error page that is displayed when a view template is missing to account for nested controller paths in the
8
+ suggested correct location for the missing template.
9
9
 
10
- CVE-2024-26143
10
+ *Joshua Young*
11
11
 
12
- * Fix ReDoS in Accept header parsing
12
+ * Add `save_and_open_page` helper to `IntegrationTest`.
13
13
 
14
- CVE-2024-26142
14
+ `save_and_open_page` is a helpful helper to keep a short feedback loop when working on system tests.
15
+ A similar helper with matching signature has been added to integration tests.
15
16
 
16
- ## Rails 7.1.3 (January 16, 2024) ##
17
+ *Joé Dupuis*
17
18
 
18
- * Fix including `Rails.application.routes.url_helpers` directly in an
19
- `ActiveSupport::Concern.`
20
-
21
- *Jonathan Hefner*
22
-
23
- * Fix system tests when using a Chrome binary that has been downloaded by
24
- Selenium.
25
-
26
- *Jonathan Hefner*
27
-
28
-
29
- ## Rails 7.1.2 (November 10, 2023) ##
30
-
31
- * Fix a race condition that could cause a `Text file busy - chromedriver`
32
- error with parallel system tests
33
-
34
- *Matt Brictson*
35
-
36
- * Fix `StrongParameters#extract_value` to include blank values
37
-
38
- Otherwise composite parameters may not be parsed correctly when one of the
39
- component is blank.
40
-
41
- *fatkodima*, *Yasha Krasnou*, *Matthias Eiglsperger*
42
-
43
- * Add `racc` as a dependency since it will become a bundled gem in Ruby 3.4.0
44
-
45
- *Hartley McGuire*
46
-
47
- * Support handling Enumerator for non-buffered responses.
48
-
49
- *Zachary Scott*
50
-
51
-
52
- ## Rails 7.1.1 (October 11, 2023) ##
53
-
54
- * No changes.
55
-
56
-
57
- ## Rails 7.1.0 (October 05, 2023) ##
58
-
59
- * No changes.
60
-
61
-
62
- ## Rails 7.1.0.rc2 (October 01, 2023) ##
63
-
64
- * No changes.
65
-
66
-
67
- ## Rails 7.1.0.rc1 (September 27, 2023) ##
68
-
69
- * Add support for `#deep_merge` and `#deep_merge!` to
70
- `ActionController::Parameters`.
71
-
72
- *Sean Doyle*
73
-
74
-
75
- ## Rails 7.1.0.beta1 (September 13, 2023) ##
76
-
77
- * `AbstractController::Translation.raise_on_missing_translations` removed
78
-
79
- This was a private API, and has been removed in favour of a more broadly applicable
80
- `config.i18n.raise_on_missing_translations`. See the upgrading guide for more information.
81
-
82
- *Alex Ghiculescu*
83
-
84
- * Add `ActionController::Parameters#extract_value` method to allow extracting serialized values from params
19
+ * Fix a regression in 7.1.3 passing a `to:` option without a controller when the controller is already defined by a scope.
85
20
 
86
21
  ```ruby
87
- params = ActionController::Parameters.new(id: "1_123", tags: "ruby,rails")
88
- params.extract_value(:id) # => ["1", "123"]
89
- params.extract_value(:tags, delimiter: ",") # => ["ruby", "rails"]
22
+ Rails.application.routes.draw do
23
+ controller :home do
24
+ get "recent", to: "recent_posts"
25
+ end
26
+ end
90
27
  ```
91
28
 
92
- *Nikita Vasilevsky*
93
-
94
- * Parse JSON `response.parsed_body` with `ActiveSupport::HashWithIndifferentAccess`
95
-
96
- Integrate with Minitest's new `assert_pattern` by parsing the JSON contents
97
- of `response.parsed_body` with `ActiveSupport::HashWithIndifferentAccess`, so
98
- that it's pattern-matching compatible.
29
+ *Étienne Barrié*
99
30
 
100
- *Sean Doyle*
31
+ * Request Forgery takes relative paths into account.
101
32
 
102
- * Add support for Playwright as a driver for system tests.
33
+ *Stefan Wienert*
103
34
 
104
- *Yuki Nishijima*
35
+ * Add ".test" as a default allowed host in development to ensure smooth golden-path setup with puma.dev.
105
36
 
106
- * Fix `HostAuthorization` potentially displaying the value of the
107
- X_FORWARDED_HOST header when the HTTP_HOST header is being blocked.
108
-
109
- *Hartley McGuire*, *Daniel Schlosser*
110
-
111
- * Rename `fixture_file_upload` method to `file_fixture_upload`
112
-
113
- Declare an alias to preserve the backwards compatibility of `fixture_file_upload`
114
-
115
- *Sean Doyle*
116
-
117
- * `ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper` saves the screenshot path in test metadata on failure.
118
-
119
- *Matija Čupić*
120
-
121
- * `config.dom_testing_default_html_version` controls the HTML parser used by
122
- `ActionDispatch::Assertions#html_document`.
123
-
124
- The Rails 7.1 default configuration opts into the HTML5 parser when it is supported, to better
125
- represent what the DOM would be in a browser user agent. Previously this test helper always used
126
- Nokogiri's HTML4 parser.
37
+ *DHH*
127
38
 
128
- *Mike Dalessio*
39
+ * Add `allow_browser` to set minimum browser versions for the application.
129
40
 
130
- * The `with_routing` helper can now be called at the class level. When called at the class level, the routes will
131
- be setup before each test, and reset after every test. For example:
41
+ A browser that's blocked will by default be served the file in `public/406-unsupported-browser.html` with a HTTP status code of "406 Not Acceptable".
132
42
 
133
43
  ```ruby
134
- class RoutingTest < ActionController::TestCase
135
- with_routing do |routes|
136
- routes.draw do
137
- resources :articles
138
- resources :authors
139
- end
140
- end
44
+ class ApplicationController < ActionController::Base
45
+ # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting + :has
46
+ allow_browser versions: :modern
47
+ end
141
48
 
142
- def test_articles_route
143
- assert_routing("/articles", controller: "articles", action: "index")
144
- end
49
+ class ApplicationController < ActionController::Base
50
+ # All versions of Chrome and Opera will be allowed, but no versions of "internet explorer" (ie). Safari needs to be 16.4+ and Firefox 121+.
51
+ allow_browser versions: { safari: 16.4, firefox: 121, ie: false }
52
+ end
145
53
 
146
- def test_authors_route
147
- assert_routing("/authors", controller: "authors", action: "index")
148
- end
54
+ class MessagesController < ApplicationController
55
+ # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action.
56
+ allow_browser versions: { opera: 104, chrome: 119 }, only: :show
149
57
  end
150
58
  ```
151
59
 
152
- *Andrew Novoselac*
153
-
154
- * The `Mime::Type` now supports handling types with parameters and correctly handles quotes.
155
- When parsing the accept header, the parameters before the q-parameter are kept and if a matching mime-type exists it is used.
156
- To keep the current functionality, a fallback is created to look for the media-type without the parameters.
157
-
158
- This change allows for custom MIME-types that are more complex like `application/vnd.api+json; profile="https://jsonapi.org/profiles/ethanresnick/cursor-pagination/" ext="https://jsonapi.org/ext/atomic"` for the [JSON API](https://jsonapi.org/).
159
-
160
- *Nicolas Erni*
161
-
162
- * The url_for helpers now support a new option called `path_params`.
163
- This is very useful in situations where you only want to add a required param that is part of the route's URL but for other route not append an extraneous query param.
60
+ *DHH*
164
61
 
165
- Given the following router...
62
+ * Add rate limiting API.
166
63
 
167
64
  ```ruby
168
- Rails.application.routes.draw do
169
- scope ":account_id" do
170
- get "dashboard" => "pages#dashboard", as: :dashboard
171
- get "search/:term" => "search#search", as: :search
172
- end
173
- delete "signout" => "sessions#destroy", as: :signout
65
+ class SessionsController < ApplicationController
66
+ rate_limit to: 10, within: 3.minutes, only: :create
174
67
  end
175
- ```
176
-
177
- And given the following `ApplicationController`
178
68
 
179
- ```ruby
180
- class ApplicationController < ActionController::Base
181
- def default_url_options
182
- { path_params: { account_id: "foo" } }
183
- end
69
+ class SignupsController < ApplicationController
70
+ rate_limit to: 1000, within: 10.seconds,
71
+ by: -> { request.domain }, with: -> { redirect_to busy_controller_url, alert: "Too many signups!" }, only: :new
184
72
  end
185
73
  ```
186
74
 
187
- The standard url_for helper and friends will now behave as follows:
188
-
189
- ```ruby
190
- dashboard_path # => /foo/dashboard
191
- dashboard_path(account_id: "bar") # => /bar/dashboard
192
-
193
- signout_path # => /signout
194
- signout_path(account_id: "bar") # => /signout?account_id=bar
195
- signout_path(account_id: "bar", path_params: { account_id: "baz" }) # => /signout?account_id=bar
196
- search_path("quin") # => /foo/search/quin
197
- ```
198
-
199
- *Jason Meller, Jeremy Beker*
200
-
201
- * Change `action_dispatch.show_exceptions` to one of `:all`, `:rescuable`, or
202
- `:none`. `:all` and `:none` behave the same as the previous `true` and
203
- `false` respectively. The new `:rescuable` option will only show exceptions
204
- that can be rescued (e.g. `ActiveRecord::RecordNotFound`). `:rescuable` is
205
- now the default for the test environment.
206
-
207
- *Jon Dufresne*
208
-
209
- * `config.action_dispatch.cookies_serializer` now accepts `:message_pack` and
210
- `:message_pack_allow_marshal` as serializers. These serializers require the
211
- [`msgpack` gem](https://rubygems.org/gems/msgpack) (>= 1.7.0).
212
-
213
- The Message Pack format can provide improved performance and smaller payload
214
- sizes. It also supports roundtripping some Ruby types that are not supported
215
- by JSON. For example:
216
-
217
- ```ruby
218
- cookies.encrypted[:foo] = [{ a: 1 }, { b: 2 }.with_indifferent_access, 1.to_d, Time.at(0, 123)]
219
-
220
- # BEFORE with config.action_dispatch.cookies_serializer = :json
221
- cookies.encrypted[:foo]
222
- # => [{"a"=>1}, {"b"=>2}, "1.0", "1969-12-31T18:00:00.000-06:00"]
223
- cookies.encrypted[:foo].map(&:class)
224
- # => [Hash, Hash, String, String]
225
-
226
- # AFTER with config.action_dispatch.cookies_serializer = :message_pack
227
- cookies.encrypted[:foo]
228
- # => [{:a=>1}, {"b"=>2}, 0.1e1, 1969-12-31 18:00:00.000123 -0600]
229
- cookies.encrypted[:foo].map(&:class)
230
- # => [Hash, ActiveSupport::HashWithIndifferentAccess, BigDecimal, Time]
231
- ```
232
-
233
- The `:message_pack` serializer can fall back to deserializing with
234
- `ActiveSupport::JSON` when necessary, and the `:message_pack_allow_marshal`
235
- serializer can fall back to deserializing with `Marshal` as well as
236
- `ActiveSupport::JSON`. Additionally, the `:marshal`, `:json`, and
237
- `:json_allow_marshal` (AKA `:hybrid`) serializers can now fall back to
238
- deserializing with `ActiveSupport::MessagePack` when necessary. These
239
- behaviors ensure old cookies can still be read so that migration is easier.
240
-
241
- *Jonathan Hefner*
75
+ *DHH*, *Jean Boussier*
242
76
 
243
- * Remove leading dot from domains on cookies set with `domain: :all`, to meet RFC6265 requirements
77
+ * Add `image/svg+xml` to the compressible content types of `ActionDispatch::Static`.
244
78
 
245
- *Gareth Adams*
79
+ *Georg Ledermann*
246
80
 
247
- * Include source location in routes extended view.
81
+ * Add instrumentation for `ActionController::Live#send_stream`.
248
82
 
249
- ```bash
250
- $ bin/rails routes --expanded
83
+ Allows subscribing to `send_stream` events. The event payload contains the filename, disposition, and type.
251
84
 
252
- ...
253
- --[ Route 14 ]----------
254
- Prefix | new_gist
255
- Verb | GET
256
- URI | /gist(.:format)
257
- Controller#Action | gists/gists#new
258
- Source Location | config/routes/gist.rb:3
259
- ```
260
-
261
- *Luan Vieira, John Hawthorn and Daniel Colson*
262
-
263
- * Add `without` as an alias of `except` on `ActiveController::Parameters`.
264
-
265
- *Hidde-Jan Jongsma*
85
+ *Hannah Ramadan*
266
86
 
267
- * Expand search field on `rails/info/routes` to also search **route name**, **http verb** and **controller#action**.
87
+ * Add support for `with_routing` test helper in `ActionDispatch::IntegrationTest`.
268
88
 
269
- *Jason Kotchoff*
89
+ *Gannon McGibbon*
270
90
 
271
- * Remove deprecated `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing.
91
+ * Remove deprecated support to set `Rails.application.config.action_dispatch.show_exceptions` to `true` and `false`.
272
92
 
273
93
  *Rafael Mendonça França*
274
94
 
275
- * Remove deprecated ability to assign a single value to `config.action_dispatch.trusted_proxies`.
95
+ * Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives.
276
96
 
277
97
  *Rafael Mendonça França*
278
98
 
279
- * Deprecate `config.action_dispatch.return_only_request_media_type_on_content_type`.
99
+ * Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`.
280
100
 
281
101
  *Rafael Mendonça França*
282
102
 
283
- * Remove deprecated behavior on `Request#content_type`.
103
+ * Deprecate `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.
284
104
 
285
105
  *Rafael Mendonça França*
286
106
 
287
- * Change `ActionController::Instrumentation` to pass `filtered_path` instead of `fullpath` in the event payload to filter sensitive query params
288
-
289
- ```ruby
290
- get "/posts?password=test"
291
- request.fullpath # => "/posts?password=test"
292
- request.filtered_path # => "/posts?password=[FILTERED]"
293
- ```
294
-
295
- *Ritikesh G*
296
-
297
- * Deprecate `AbstractController::Helpers::MissingHelperError`
298
-
299
- *Hartley McGuire*
300
-
301
- * Change `ActionDispatch::Testing::TestResponse#parsed_body` to parse HTML as
302
- a Nokogiri document
303
-
304
- ```ruby
305
- get "/posts"
306
- response.content_type # => "text/html; charset=utf-8"
307
- response.parsed_body.class # => Nokogiri::HTML5::Document
308
- response.parsed_body.to_html # => "<!DOCTYPE html>\n<html>\n..."
309
- ```
310
-
311
- *Sean Doyle*
312
-
313
- * Deprecate `ActionDispatch::IllegalStateError`.
107
+ * Remove deprecated comparison between `ActionController::Parameters` and `Hash`.
314
108
 
315
- *Samuel Williams*
109
+ *Rafael Mendonça França*
316
110
 
317
- * Add HTTP::Request#route_uri_pattern that returns URI pattern of matched route.
111
+ * Remove deprecated constant `AbstractController::Helpers::MissingHelperError`.
318
112
 
319
- *Joel Hawksley*, *Kate Higa*
113
+ *Rafael Mendonça França*
320
114
 
321
- * Add `ActionDispatch::AssumeSSL` middleware that can be turned on via `config.assume_ssl`.
322
- It makes the application believe that all requests are arriving over SSL. This is useful
323
- when proxying through a load balancer that terminates SSL, the forwarded request will appear
324
- as though its HTTP instead of HTTPS to the application. This makes redirects and cookie
325
- security target HTTP instead of HTTPS. This middleware makes the server assume that the
326
- proxy already terminated SSL, and that the request really is HTTPS.
115
+ * Fix a race condition that could cause a `Text file busy - chromedriver`
116
+ error with parallel system tests.
327
117
 
328
- *DHH*
118
+ *Matt Brictson*
329
119
 
330
- * Only use HostAuthorization middleware if `config.hosts` is not empty
120
+ * Add `racc` as a dependency since it will become a bundled gem in Ruby 3.4.0
331
121
 
332
122
  *Hartley McGuire*
123
+ * Remove deprecated constant `ActionDispatch::IllegalStateError`.
333
124
 
334
- * Allow raising an error when a callback's only/unless symbols aren't existing methods.
335
-
336
- When `before_action :callback, only: :action_name` is declared on a controller that doesn't respond to `action_name`, raise an exception at request time. This is a safety measure to ensure that typos or forgetfulness don't prevent a crucial callback from being run when it should.
337
-
338
- For new applications, raising an error for undefined actions is turned on by default. If you do not want to opt-in to this behavior set `config.action_controller.raise_on_missing_callback_actions` to `false` in your application configuration. See #43487 for more details.
339
-
340
- *Jess Bees*
341
-
342
- * Allow cookie options[:domain] to accept a proc to set the cookie domain on a more flexible per-request basis
343
-
344
- *RobL*
345
-
346
- * When a host is not specified for an `ActionController::Renderer`'s env,
347
- the host and related options will now be derived from the routes'
348
- `default_url_options` and `ActionDispatch::Http::URL.secure_protocol`.
349
-
350
- This means that for an application with a configuration like:
351
-
352
- ```ruby
353
- Rails.application.default_url_options = { host: "rubyonrails.org" }
354
- Rails.application.config.force_ssl = true
355
- ```
356
-
357
- rendering a URL like:
358
-
359
- ```ruby
360
- ApplicationController.renderer.render inline: "<%= blog_url %>"
361
- ```
362
-
363
- will now return `"https://rubyonrails.org/blog"` instead of
364
- `"http://example.org/blog"`.
365
-
366
- *Jonathan Hefner*
367
-
368
- * Add details of cookie name and size to `CookieOverflow` exception.
369
-
370
- *Andy Waite*
371
-
372
- * Don't double log the `controller`, `action`, or `namespaced_controller` when using `ActiveRecord::QueryLog`
373
-
374
- Previously if you set `config.active_record.query_log_tags` to an array that included
375
- `:controller`, `:namespaced_controller`, or `:action`, that item would get logged twice.
376
- This bug has been fixed.
377
-
378
- *Alex Ghiculescu*
379
-
380
- * Add the following permissions policy directives: `hid`, `idle-detection`, `screen-wake-lock`,
381
- `serial`, `sync-xhr`, `web-share`.
382
-
383
- *Guillaume Cabanel*
384
-
385
- * The `speaker`, `vibrate`, and `vr` permissions policy directives are now
386
- deprecated.
387
-
388
- There is no browser support for these directives, and no plan for browser
389
- support in the future. You can just remove these directives from your
390
- application.
391
-
392
- *Jonathan Hefner*
393
-
394
- * Added the `:status` option to `assert_redirected_to` to specify the precise
395
- HTTP status of the redirect. Defaults to `:redirect` for backwards
396
- compatibility.
397
-
398
- *Jon Dufresne*
399
-
400
- * Rescue `JSON::ParserError` in Cookies JSON deserializer to discards marshal dumps:
401
-
402
- Without this change, if `action_dispatch.cookies_serializer` is set to `:json` and
403
- the app tries to read a `:marshal` serialized cookie, it would error out which wouldn't
404
- clear the cookie and force app users to manually clear it in their browser.
405
-
406
- (See #45127 for original bug discussion)
407
-
408
- *Nathan Bardoux*
409
-
410
- * Add `HTTP_REFERER` when following redirects on integration tests
411
-
412
- This makes `follow_redirect!` a closer simulation of what happens in a real browser
413
-
414
- *Felipe Sateler*
415
-
416
- * Added `exclude?` method to `ActionController::Parameters`.
417
-
418
- *Ian Neubert*
419
-
420
- * Rescue `EOFError` exception from `rack` on a multipart request.
421
-
422
- *Nikita Vasilevsky*
423
-
424
- * Log redirects from routes the same way as redirects from controllers.
425
-
426
- *Dennis Paagman*
427
-
428
- * Prevent `ActionDispatch::ServerTiming` from overwriting existing values in `Server-Timing`.
429
- Previously, if another middleware down the chain set `Server-Timing` header,
430
- it would overwritten by `ActionDispatch::ServerTiming`.
431
-
432
- *Jakub Malinowski*
433
-
434
- * Allow opting out of the `SameSite` cookie attribute when setting a cookie.
435
-
436
- You can opt out of `SameSite` by passing `same_site: nil`.
437
-
438
- `cookies[:foo] = { value: "bar", same_site: nil }`
439
-
440
- Previously, this incorrectly set the `SameSite` attribute to the value of the `cookies_same_site_protection` setting.
441
-
442
- *Alex Ghiculescu*
443
-
444
- * Allow using `helper_method`s in `content_security_policy` and `permissions_policy`
445
-
446
- Previously you could access basic helpers (defined in helper modules), but not
447
- helper methods defined using `helper_method`. Now you can use either.
448
-
449
- ```ruby
450
- content_security_policy do |p|
451
- p.default_src "https://example.com"
452
- p.script_src "https://example.com" if helpers.script_csp?
453
- end
454
- ```
455
-
456
- *Alex Ghiculescu*
457
-
458
- * Reimplement `ActionController::Parameters#has_value?` and `#value?` to avoid parameters and hashes comparison.
459
-
460
- Deprecated equality between parameters and hashes is going to be removed in Rails 7.2.
461
- The new implementation takes care of conversions.
462
-
463
- *Seva Stefkin*
464
-
465
- * Allow only String and Symbol keys in `ActionController::Parameters`.
466
- Raise `ActionController::InvalidParameterKey` when initializing Parameters
467
- with keys that aren't strings or symbols.
468
-
469
- *Seva Stefkin*
470
-
471
- * Add the ability to use custom logic for storing and retrieving CSRF tokens.
472
-
473
- By default, the token will be stored in the session. Custom classes can be
474
- defined to specify arbitrary behavior, but the ability to store them in
475
- encrypted cookies is built in.
476
-
477
- *Andrew Kowpak*
478
-
479
- * Make ActionController::Parameters#values cast nested hashes into parameters.
480
-
481
- *Gannon McGibbon*
482
-
483
- * Introduce `html:` and `screenshot:` kwargs for system test screenshot helper
484
-
485
- Use these as an alternative to the already-available environment variables.
486
-
487
- For example, this will display a screenshot in iTerm, save the HTML, and output
488
- its path.
489
-
490
- ```ruby
491
- take_screenshot(html: true, screenshot: "inline")
492
- ```
493
-
494
- *Alex Ghiculescu*
495
-
496
- * Allow `ActionController::Parameters#to_h` to receive a block.
497
-
498
- *Bob Farrell*
499
-
500
- * Allow relative redirects when `raise_on_open_redirects` is enabled
501
-
502
- *Tom Hughes*
503
-
504
- * Allow Content Security Policy DSL to generate for API responses.
505
-
506
- *Tim Wade*
507
-
508
- * Fix `authenticate_with_http_basic` to allow for missing password.
509
-
510
- Before Rails 7.0 it was possible to handle basic authentication with only a username.
511
-
512
- ```ruby
513
- authenticate_with_http_basic do |token, _|
514
- ApiClient.authenticate(token)
515
- end
516
- ```
517
-
518
- This ability is restored.
519
-
520
- *Jean Boussier*
521
-
522
- * Fix `content_security_policy` returning invalid directives.
523
-
524
- Directives such as `self`, `unsafe-eval` and few others were not
525
- single quoted when the directive was the result of calling a lambda
526
- returning an array.
527
-
528
- ```ruby
529
- content_security_policy do |policy|
530
- policy.frame_ancestors lambda { [:self, "https://example.com"] }
531
- end
532
- ```
533
-
534
- With this fix the policy generated from above will now be valid.
535
-
536
- *Edouard Chin*
537
-
538
- * Fix `skip_forgery_protection` to run without raising an error if forgery
539
- protection has not been enabled / `verify_authenticity_token` is not a
540
- defined callback.
541
-
542
- This fix prevents the Rails 7.0 Welcome Page (`/`) from raising an
543
- `ArgumentError` if `default_protect_from_forgery` is false.
544
-
545
- *Brad Trick*
546
-
547
- * Make `redirect_to` return an empty response body.
548
-
549
- Application controllers that wish to add a response body after calling
550
- `redirect_to` can continue to do so.
551
-
552
- *Jon Dufresne*
553
-
554
- * Use non-capturing group for subdomain matching in `ActionDispatch::HostAuthorization`
555
-
556
- Since we do nothing with the captured subdomain group, we can use a non-capturing group instead.
557
-
558
- *Sam Bostock*
559
-
560
- * Fix `ActionController::Live` to copy the IsolatedExecutionState in the ephemeral thread.
561
-
562
- Since its inception `ActionController::Live` has been copying thread local variables
563
- to keep things such as `CurrentAttributes` set from middlewares working in the controller action.
564
-
565
- With the introduction of `IsolatedExecutionState` in 7.0, some of that global state was lost in
566
- `ActionController::Live` controllers.
567
-
568
- *Jean Boussier*
569
-
570
- * Fix setting `trailing_slash: true` in route definition.
571
-
572
- ```ruby
573
- get '/test' => "test#index", as: :test, trailing_slash: true
574
-
575
- test_path() # => "/test/"
576
- ```
577
-
578
- *Jean Boussier*
579
-
580
- * Make `Session#merge!` stringify keys.
581
-
582
- Previously `Session#update` would, but `merge!` wouldn't.
125
+ *Rafael Mendonça França*
583
126
 
584
- *Drew Bragg*
127
+ * Add parameter filter capability for redirect locations.
585
128
 
586
- * Add `:unsafe_hashes` mapping for `content_security_policy`
129
+ It uses the `config.filter_parameters` to match what needs to be filtered.
130
+ The result would be like this:
587
131
 
588
- ```ruby
589
- # Before
590
- policy.script_src :strict_dynamic, "'unsafe-hashes'", "'sha256-rRMdkshZyJlCmDX27XnL7g3zXaxv7ei6Sg+yt4R3svU='"
132
+ Redirected to http://secret.foo.bar?username=roque&password=[FILTERED]
591
133
 
592
- # After
593
- policy.script_src :strict_dynamic, :unsafe_hashes, "'sha256-rRMdkshZyJlCmDX27XnL7g3zXaxv7ei6Sg+yt4R3svU='"
594
- ```
134
+ Fixes #14055.
595
135
 
596
- *Igor Morozov*
136
+ *Roque Pinel*, *Trevor Turk*, *tonytonyjan*
597
137
 
598
- Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionpack/CHANGELOG.md) for previous changes.
138
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actionpack/CHANGELOG.md) for previous changes.