actionpack 7.1.3 → 7.2.1.1

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