actionpack 7.0.8 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +76 -520
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +2 -2
  5. data/lib/abstract_controller/asset_paths.rb +2 -0
  6. data/lib/abstract_controller/base.rb +119 -106
  7. data/lib/abstract_controller/caching/fragments.rb +51 -52
  8. data/lib/abstract_controller/caching.rb +2 -0
  9. data/lib/abstract_controller/callbacks.rb +94 -67
  10. data/lib/abstract_controller/collector.rb +6 -6
  11. data/lib/abstract_controller/deprecator.rb +9 -0
  12. data/lib/abstract_controller/error.rb +2 -0
  13. data/lib/abstract_controller/helpers.rb +119 -91
  14. data/lib/abstract_controller/logger.rb +2 -0
  15. data/lib/abstract_controller/railties/routes_helpers.rb +3 -16
  16. data/lib/abstract_controller/rendering.rb +14 -13
  17. data/lib/abstract_controller/translation.rb +15 -11
  18. data/lib/abstract_controller/url_for.rb +9 -5
  19. data/lib/abstract_controller.rb +8 -0
  20. data/lib/action_controller/api/api_rendering.rb +2 -0
  21. data/lib/action_controller/api.rb +77 -73
  22. data/lib/action_controller/base.rb +199 -141
  23. data/lib/action_controller/caching.rb +16 -11
  24. data/lib/action_controller/deprecator.rb +9 -0
  25. data/lib/action_controller/form_builder.rb +21 -16
  26. data/lib/action_controller/log_subscriber.rb +19 -5
  27. data/lib/action_controller/metal/allow_browser.rb +123 -0
  28. data/lib/action_controller/metal/basic_implicit_render.rb +2 -0
  29. data/lib/action_controller/metal/conditional_get.rb +188 -174
  30. data/lib/action_controller/metal/content_security_policy.rb +26 -25
  31. data/lib/action_controller/metal/cookies.rb +4 -2
  32. data/lib/action_controller/metal/data_streaming.rb +65 -54
  33. data/lib/action_controller/metal/default_headers.rb +6 -2
  34. data/lib/action_controller/metal/etag_with_flash.rb +4 -0
  35. data/lib/action_controller/metal/etag_with_template_digest.rb +18 -14
  36. data/lib/action_controller/metal/exceptions.rb +19 -9
  37. data/lib/action_controller/metal/flash.rb +12 -10
  38. data/lib/action_controller/metal/head.rb +20 -16
  39. data/lib/action_controller/metal/helpers.rb +64 -67
  40. data/lib/action_controller/metal/http_authentication.rb +216 -199
  41. data/lib/action_controller/metal/implicit_render.rb +21 -17
  42. data/lib/action_controller/metal/instrumentation.rb +22 -12
  43. data/lib/action_controller/metal/live.rb +122 -92
  44. data/lib/action_controller/metal/logging.rb +6 -4
  45. data/lib/action_controller/metal/mime_responds.rb +151 -142
  46. data/lib/action_controller/metal/parameter_encoding.rb +34 -32
  47. data/lib/action_controller/metal/params_wrapper.rb +58 -58
  48. data/lib/action_controller/metal/permissions_policy.rb +14 -13
  49. data/lib/action_controller/metal/rate_limiting.rb +62 -0
  50. data/lib/action_controller/metal/redirecting.rb +110 -84
  51. data/lib/action_controller/metal/renderers.rb +50 -49
  52. data/lib/action_controller/metal/rendering.rb +103 -82
  53. data/lib/action_controller/metal/request_forgery_protection.rb +279 -161
  54. data/lib/action_controller/metal/rescue.rb +12 -8
  55. data/lib/action_controller/metal/streaming.rb +174 -132
  56. data/lib/action_controller/metal/strong_parameters.rb +598 -473
  57. data/lib/action_controller/metal/testing.rb +2 -0
  58. data/lib/action_controller/metal/url_for.rb +23 -14
  59. data/lib/action_controller/metal.rb +145 -61
  60. data/lib/action_controller/railtie.rb +25 -9
  61. data/lib/action_controller/railties/helpers.rb +2 -0
  62. data/lib/action_controller/renderer.rb +105 -66
  63. data/lib/action_controller/template_assertions.rb +4 -2
  64. data/lib/action_controller/test_case.rb +155 -125
  65. data/lib/action_controller.rb +17 -3
  66. data/lib/action_dispatch/constants.rb +34 -0
  67. data/lib/action_dispatch/deprecator.rb +9 -0
  68. data/lib/action_dispatch/http/cache.rb +28 -29
  69. data/lib/action_dispatch/http/content_disposition.rb +2 -0
  70. data/lib/action_dispatch/http/content_security_policy.rb +52 -45
  71. data/lib/action_dispatch/http/filter_parameters.rb +18 -8
  72. data/lib/action_dispatch/http/filter_redirect.rb +15 -1
  73. data/lib/action_dispatch/http/headers.rb +23 -21
  74. data/lib/action_dispatch/http/mime_negotiation.rb +37 -48
  75. data/lib/action_dispatch/http/mime_type.rb +60 -30
  76. data/lib/action_dispatch/http/mime_types.rb +5 -1
  77. data/lib/action_dispatch/http/parameters.rb +12 -10
  78. data/lib/action_dispatch/http/permissions_policy.rb +32 -34
  79. data/lib/action_dispatch/http/rack_cache.rb +4 -0
  80. data/lib/action_dispatch/http/request.rb +113 -79
  81. data/lib/action_dispatch/http/response.rb +136 -103
  82. data/lib/action_dispatch/http/upload.rb +19 -15
  83. data/lib/action_dispatch/http/url.rb +75 -73
  84. data/lib/action_dispatch/journey/formatter.rb +19 -6
  85. data/lib/action_dispatch/journey/gtg/builder.rb +4 -3
  86. data/lib/action_dispatch/journey/gtg/simulator.rb +2 -0
  87. data/lib/action_dispatch/journey/gtg/transition_table.rb +10 -8
  88. data/lib/action_dispatch/journey/nfa/dot.rb +2 -0
  89. data/lib/action_dispatch/journey/nodes/node.rb +6 -5
  90. data/lib/action_dispatch/journey/parser.rb +4 -3
  91. data/lib/action_dispatch/journey/parser_extras.rb +2 -0
  92. data/lib/action_dispatch/journey/path/pattern.rb +18 -15
  93. data/lib/action_dispatch/journey/route.rb +12 -9
  94. data/lib/action_dispatch/journey/router/utils.rb +16 -15
  95. data/lib/action_dispatch/journey/router.rb +13 -10
  96. data/lib/action_dispatch/journey/routes.rb +6 -4
  97. data/lib/action_dispatch/journey/scanner.rb +4 -2
  98. data/lib/action_dispatch/journey/visitors.rb +2 -0
  99. data/lib/action_dispatch/journey.rb +2 -0
  100. data/lib/action_dispatch/log_subscriber.rb +25 -0
  101. data/lib/action_dispatch/middleware/actionable_exceptions.rb +7 -6
  102. data/lib/action_dispatch/middleware/assume_ssl.rb +27 -0
  103. data/lib/action_dispatch/middleware/callbacks.rb +4 -0
  104. data/lib/action_dispatch/middleware/cookies.rb +192 -194
  105. data/lib/action_dispatch/middleware/debug_exceptions.rb +36 -27
  106. data/lib/action_dispatch/middleware/debug_locks.rb +18 -13
  107. data/lib/action_dispatch/middleware/debug_view.rb +9 -2
  108. data/lib/action_dispatch/middleware/exception_wrapper.rb +181 -27
  109. data/lib/action_dispatch/middleware/executor.rb +9 -1
  110. data/lib/action_dispatch/middleware/flash.rb +65 -46
  111. data/lib/action_dispatch/middleware/host_authorization.rb +22 -17
  112. data/lib/action_dispatch/middleware/public_exceptions.rb +12 -8
  113. data/lib/action_dispatch/middleware/reloader.rb +9 -5
  114. data/lib/action_dispatch/middleware/remote_ip.rb +89 -83
  115. data/lib/action_dispatch/middleware/request_id.rb +15 -8
  116. data/lib/action_dispatch/middleware/server_timing.rb +8 -6
  117. data/lib/action_dispatch/middleware/session/abstract_store.rb +7 -0
  118. data/lib/action_dispatch/middleware/session/cache_store.rb +14 -7
  119. data/lib/action_dispatch/middleware/session/cookie_store.rb +32 -25
  120. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +9 -3
  121. data/lib/action_dispatch/middleware/show_exceptions.rb +42 -28
  122. data/lib/action_dispatch/middleware/ssl.rb +60 -45
  123. data/lib/action_dispatch/middleware/stack.rb +15 -9
  124. data/lib/action_dispatch/middleware/static.rb +40 -34
  125. data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +2 -2
  126. data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +4 -4
  127. data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +8 -1
  128. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +7 -7
  129. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +2 -2
  130. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +17 -0
  131. data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +16 -12
  132. data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +1 -1
  133. data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +3 -3
  134. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +4 -4
  135. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +1 -1
  136. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +1 -1
  137. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +3 -0
  138. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +47 -38
  139. data/lib/action_dispatch/railtie.rb +12 -4
  140. data/lib/action_dispatch/request/session.rb +39 -27
  141. data/lib/action_dispatch/request/utils.rb +10 -3
  142. data/lib/action_dispatch/routing/endpoint.rb +2 -0
  143. data/lib/action_dispatch/routing/inspector.rb +59 -9
  144. data/lib/action_dispatch/routing/mapper.rb +684 -638
  145. data/lib/action_dispatch/routing/polymorphic_routes.rb +70 -61
  146. data/lib/action_dispatch/routing/redirection.rb +52 -38
  147. data/lib/action_dispatch/routing/route_set.rb +105 -61
  148. data/lib/action_dispatch/routing/routes_proxy.rb +16 -19
  149. data/lib/action_dispatch/routing/url_for.rb +131 -122
  150. data/lib/action_dispatch/routing.rb +152 -150
  151. data/lib/action_dispatch/system_test_case.rb +91 -81
  152. data/lib/action_dispatch/system_testing/browser.rb +27 -19
  153. data/lib/action_dispatch/system_testing/driver.rb +16 -22
  154. data/lib/action_dispatch/system_testing/server.rb +2 -0
  155. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +53 -31
  156. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +2 -0
  157. data/lib/action_dispatch/testing/assertion_response.rb +9 -7
  158. data/lib/action_dispatch/testing/assertions/response.rb +36 -26
  159. data/lib/action_dispatch/testing/assertions/routing.rb +203 -95
  160. data/lib/action_dispatch/testing/assertions.rb +5 -1
  161. data/lib/action_dispatch/testing/integration.rb +240 -229
  162. data/lib/action_dispatch/testing/request_encoder.rb +6 -1
  163. data/lib/action_dispatch/testing/test_helpers/page_dump_helper.rb +35 -0
  164. data/lib/action_dispatch/testing/test_process.rb +14 -9
  165. data/lib/action_dispatch/testing/test_request.rb +4 -2
  166. data/lib/action_dispatch/testing/test_response.rb +34 -19
  167. data/lib/action_dispatch.rb +49 -22
  168. data/lib/action_pack/gem_version.rb +5 -3
  169. data/lib/action_pack/version.rb +3 -1
  170. data/lib/action_pack.rb +18 -17
  171. metadata +88 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 554db7a8936fc5a1d81baf26f67a4d031f2e7b3c01022695ae842c4a06aa3085
4
- data.tar.gz: ceb0aad8f1a9abb47bf6bdc79740dc772cbbbd5d06513f9b19e3dae9d77f1c3b
3
+ metadata.gz: 1c6dfb6390c5d4c6038c8aef6a4c79dd69ac971cc460d4e4f915e3c0c104b09b
4
+ data.tar.gz: 4427bf987fa2fa103840ee22673c241e136e978dd29d4d29d2b7f370dc1dc2b8
5
5
  SHA512:
6
- metadata.gz: d6a7fcc80e5f12c8eac3ba474094cf9087049389793f2953e49d25b3519637329bf8ab440e2af2c8427acbf79d1b6e67204e1e907cc8d9ce3bc7ab9ff65e5e89
7
- data.tar.gz: dfed11835f0aa991c57841aba4ae0a1def553bf086de35bc86db01f2b4424cb9d29823fff6f07ad2fabcc7cc15d752cf7c8b488cf4bf48300ca338e56c8abe2c
6
+ metadata.gz: cc8f57cd76f9e51ac42c10970feceedce22c9374f02d5eb96f4812009cba4e1d68b4d2a7bad8f081d939f6628b0447dd73051a32a590cddfa375f8a3084b3a17
7
+ data.tar.gz: 1fa922c393a19ec07ae0b9b615ed3bcc82a365f342270be2308c5dc16b8cd871d82f34c78b486aa981e97308aeefdf3d74cdedb91073602e84219ec05f75c520
data/CHANGELOG.md CHANGED
@@ -1,591 +1,147 @@
1
- ## Rails 7.0.8 (September 09, 2023) ##
1
+ ## Rails 7.2.0 (August 09, 2024) ##
2
2
 
3
- * Fix `HostAuthorization` potentially displaying the value of the
4
- X_FORWARDED_HOST header when the HTTP_HOST header is being blocked.
3
+ * Allow bots to ignore `allow_browser`.
5
4
 
6
- *Hartley McGuire*, *Daniel Schlosser*
5
+ *Matthew Nguyen*
7
6
 
7
+ * Include the HTTP Permissions-Policy on non-HTML Content-Types
8
+ [CVE-2024-28103]
8
9
 
9
- ## Rails 7.0.7.2 (August 22, 2023) ##
10
+ *Aaron Patterson*, *Zack Deveau*
10
11
 
11
- * No changes.
12
+ * Fix `Mime::Type.parse` handling type parameters for HTTP Accept headers.
12
13
 
14
+ *Taylor Chaparro*
13
15
 
14
- ## Rails 7.0.7.1 (August 22, 2023) ##
16
+ * Fix the error page that is displayed when a view template is missing to account for nested controller paths in the
17
+ suggested correct location for the missing template.
15
18
 
16
- * No changes.
19
+ *Joshua Young*
17
20
 
21
+ * Add `save_and_open_page` helper to `IntegrationTest`.
18
22
 
19
- ## Rails 7.0.7 (August 09, 2023) ##
23
+ `save_and_open_page` is a helpful helper to keep a short feedback loop when working on system tests.
24
+ A similar helper with matching signature has been added to integration tests.
20
25
 
21
- * No changes.
26
+ *Joé Dupuis*
22
27
 
23
-
24
- ## Rails 7.0.6 (June 29, 2023) ##
25
-
26
- * No changes.
27
-
28
-
29
- ## Rails 7.0.5.1 (June 26, 2023) ##
30
-
31
- * Raise an exception if illegal characters are provide to redirect_to
32
- [CVE-2023-28362]
33
-
34
- *Zack Deveau*
35
-
36
- ## Rails 7.0.5 (May 24, 2023) ##
37
-
38
- * Do not return CSP headers for 304 Not Modified responses.
39
-
40
- *Tobias Kraze*
41
-
42
- * Fix `EtagWithFlash` when there is no `Flash` middleware available.
43
-
44
- *fatkodima*
45
-
46
- * Fix content-type header with `send_stream`.
47
-
48
- *Elliot Crosby-McCullough*
49
-
50
- * Address Selenium `:capabilities` deprecation warning.
51
-
52
- *Ron Shinall*
53
-
54
- * Fix cookie domain for domain: all on two letter single level TLD.
55
-
56
- *John Hawthorn*
57
-
58
- * Don't double log the `controller`, `action`, or `namespaced_controller` when using `ActiveRecord::QueryLog`
59
-
60
- Previously if you set `config.active_record.query_log_tags` to an array that included
61
- `:controller`, `:namespaced_controller`, or `:action`, that item would get logged twice.
62
- This bug has been fixed.
63
-
64
- *Alex Ghiculescu*
65
-
66
- * Rescue `EOFError` exception from `rack` on a multipart request.
67
-
68
- *Nikita Vasilevsky*
69
-
70
- * Rescue `JSON::ParserError` in Cookies json deserializer to discards marshal dumps:
71
-
72
- Without this change, if `action_dispatch.cookies_serializer` is set to `:json` and
73
- the app tries to read a `:marshal` serialized cookie, it would error out which wouldn't
74
- clear the cookie and force app users to manually clear it in their browser.
75
-
76
- (See #45127 for original bug discussion)
77
-
78
- *Nathan Bardoux*
79
-
80
- ## Rails 7.0.4.3 (March 13, 2023) ##
81
-
82
- * No changes.
83
-
84
-
85
- ## Rails 7.0.4.2 (January 24, 2023) ##
86
-
87
- * Fix `domain: :all` for two letter TLD
88
-
89
- This fixes a compatibility issue introduced in our previous security
90
- release when using `domain: :all` with a two letter but single level top
91
- level domain domain (like `.ca`, rather than `.co.uk`).
92
-
93
-
94
- ## Rails 7.0.4.1 (January 17, 2023) ##
95
-
96
- * Fix sec issue with _url_host_allowed?
97
-
98
- Disallow certain strings from `_url_host_allowed?` to avoid a redirect
99
- to malicious sites.
100
-
101
- [CVE-2023-22797]
102
-
103
- * Avoid regex backtracking on If-None-Match header
104
-
105
- [CVE-2023-22795]
106
-
107
- * Use string#split instead of regex for domain parts
108
-
109
- [CVE-2023-22792]
110
-
111
- ## Rails 7.0.4 (September 09, 2022) ##
112
-
113
- * Prevent `ActionDispatch::ServerTiming` from overwriting existing values in `Server-Timing`.
114
-
115
- Previously, if another middleware down the chain set `Server-Timing` header,
116
- it would overwritten by `ActionDispatch::ServerTiming`.
117
-
118
- *Jakub Malinowski*
119
-
120
-
121
- ## Rails 7.0.3.1 (July 12, 2022) ##
122
-
123
- * No changes.
124
-
125
-
126
- ## Rails 7.0.3 (May 09, 2022) ##
127
-
128
- * Allow relative redirects when `raise_on_open_redirects` is enabled.
129
-
130
- *Tom Hughes*
131
-
132
- * Fix `authenticate_with_http_basic` to allow for missing password.
133
-
134
- Before Rails 7.0 it was possible to handle basic authentication with only a username.
28
+ * Fix a regression in 7.1.3 passing a `to:` option without a controller when the controller is already defined by a scope.
135
29
 
136
30
  ```ruby
137
- authenticate_with_http_basic do |token, _|
138
- ApiClient.authenticate(token)
139
- end
140
- ```
141
-
142
- This ability is restored.
143
-
144
- *Jean Boussier*
145
-
146
- * Fix `content_security_policy` returning invalid directives.
147
-
148
- Directives such as `self`, `unsafe-eval` and few others were not
149
- single quoted when the directive was the result of calling a lambda
150
- returning an array.
151
-
152
- ```ruby
153
- content_security_policy do |policy|
154
- policy.frame_ancestors lambda { [:self, "https://example.com"] }
31
+ Rails.application.routes.draw do
32
+ controller :home do
33
+ get "recent", to: "recent_posts"
34
+ end
155
35
  end
156
36
  ```
157
37
 
158
- With this fix the policy generated from above will now be valid.
159
-
160
- *Edouard Chin*
161
-
162
- * Fix `skip_forgery_protection` to run without raising an error if forgery
163
- protection has not been enabled / `verify_authenticity_token` is not a
164
- defined callback.
165
-
166
- This fix prevents the Rails 7.0 Welcome Page (`/`) from raising an
167
- `ArgumentError` if `default_protect_from_forgery` is false.
168
-
169
- *Brad Trick*
170
-
171
- * Fix `ActionController::Live` to copy the IsolatedExecutionState in the ephemeral thread.
172
-
173
- Since its inception `ActionController::Live` has been copying thread local variables
174
- to keep things such as `CurrentAttributes` set from middlewares working in the controller action.
175
-
176
- With the introduction of `IsolatedExecutionState` in 7.0, some of that global state was lost in
177
- `ActionController::Live` controllers.
178
-
179
- *Jean Boussier*
180
-
181
- * Fix setting `trailing_slash: true` in route definition.
182
-
183
- ```ruby
184
- get '/test' => "test#index", as: :test, trailing_slash: true
185
-
186
- test_path() # => "/test/"
187
- ```
188
-
189
- *Jean Boussier*
190
-
191
- ## Rails 7.0.2.4 (April 26, 2022) ##
192
-
193
- * Allow Content Security Policy DSL to generate for API responses.
194
-
195
- *Tim Wade*
196
-
197
- ## Rails 7.0.2.3 (March 08, 2022) ##
198
-
199
- * No changes.
200
-
201
-
202
- ## Rails 7.0.2.2 (February 11, 2022) ##
203
-
204
- * No changes.
205
-
206
-
207
- ## Rails 7.0.2.1 (February 11, 2022) ##
208
-
209
- * Under certain circumstances, the middleware isn't informed that the
210
- response body has been fully closed which result in request state not
211
- being fully reset before the next request
212
-
213
- [CVE-2022-23633]
214
-
215
-
216
- ## Rails 7.0.2 (February 08, 2022) ##
217
-
218
- * No changes.
219
-
220
-
221
- ## Rails 7.0.1 (January 06, 2022) ##
222
-
223
- * Fix `ActionController::Parameters` methods to keep the original logger context when creating a new copy
224
- of the original object.
225
-
226
- *Yutaka Kamei*
227
-
228
-
229
- ## Rails 7.0.0 (December 15, 2021) ##
230
-
231
- * Deprecate `Rails.application.config.action_controller.urlsafe_csrf_tokens`. This config is now always enabled.
232
-
233
38
  *Étienne Barrié*
234
39
 
235
- * Instance variables set in requests in a `ActionController::TestCase` are now cleared before the next request
236
-
237
- This means if you make multiple requests in the same test, instance variables set in the first request will
238
- not persist into the second one. (It's not recommended to make multiple requests in the same test.)
239
-
240
- *Alex Ghiculescu*
241
-
242
-
243
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
244
-
245
- * No changes.
40
+ * Request Forgery takes relative paths into account.
246
41
 
42
+ *Stefan Wienert*
247
43
 
248
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
44
+ * Add ".test" as a default allowed host in development to ensure smooth golden-path setup with puma.dev.
249
45
 
250
- * Fix X_FORWARDED_HOST protection. [CVE-2021-44528]
251
-
252
-
253
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
254
-
255
- * `Rails.application.executor` hooks can now be called around every request in a `ActionController::TestCase`
256
-
257
- This helps to better simulate request or job local state being reset between requests and prevent state
258
- leaking from one request to another.
259
-
260
- To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
261
-
262
- *Alex Ghiculescu*
263
-
264
- * Consider onion services secure for cookies.
265
-
266
- *Justin Tracey*
267
-
268
- * Remove deprecated `Rails.config.action_view.raise_on_missing_translations`.
269
-
270
- *Rafael Mendonça França*
271
-
272
- * Remove deprecated support to passing a path to `fixture_file_upload` relative to `fixture_path`.
273
-
274
- *Rafael Mendonça França*
275
-
276
- * Remove deprecated `ActionDispatch::SystemTestCase#host!`.
277
-
278
- *Rafael Mendonça França*
279
-
280
- * Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
281
-
282
- *Rafael Mendonça França*
283
-
284
- * Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
285
-
286
- *Rafael Mendonça França*
46
+ *DHH*
287
47
 
288
- * Raise `ActionController::Redirecting::UnsafeRedirectError` for unsafe `redirect_to` redirects.
48
+ * Add `allow_browser` to set minimum browser versions for the application.
289
49
 
290
- This allows `rescue_from` to be used to add a default fallback route:
50
+ 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".
291
51
 
292
52
  ```ruby
293
- rescue_from ActionController::Redirecting::UnsafeRedirectError do
294
- redirect_to root_url
53
+ class ApplicationController < ActionController::Base
54
+ # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting + :has
55
+ allow_browser versions: :modern
295
56
  end
296
- ```
297
-
298
- *Kasper Timm Hansen*, *Chris Oliver*
299
57
 
300
- * Add `url_from` to verify a redirect location is internal.
301
-
302
- Takes the open redirect protection from `redirect_to` so users can wrap a
303
- param, and fall back to an alternate redirect URL when the param provided
304
- one is unsafe.
58
+ class ApplicationController < ActionController::Base
59
+ # 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+.
60
+ allow_browser versions: { safari: 16.4, firefox: 121, ie: false }
61
+ end
305
62
 
306
- ```ruby
307
- def create
308
- redirect_to url_from(params[:redirect_url]) || root_url
63
+ class MessagesController < ApplicationController
64
+ # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action.
65
+ allow_browser versions: { opera: 104, chrome: 119 }, only: :show
309
66
  end
310
67
  ```
311
68
 
312
- *dmcge*, *Kasper Timm Hansen*
313
-
314
- * Allow Capybara driver name overrides in `SystemTestCase::driven_by`
315
-
316
- Allow users to prevent conflicts among drivers that use the same driver
317
- type (selenium, poltergeist, webkit, rack test).
318
-
319
- Fixes #42502
320
-
321
- *Chris LaRose*
322
-
323
- * Allow multiline to be passed in routes when using wildcard segments.
69
+ *DHH*
324
70
 
325
- Previously routes with newlines weren't detected when using wildcard segments, returning
326
- a `No route matches` error.
327
- After this change, routes with newlines are detected on wildcard segments. Example
71
+ * Add rate limiting API.
328
72
 
329
73
  ```ruby
330
- draw do
331
- get "/wildcard/*wildcard_segment", to: SimpleApp.new("foo#index"), as: :wildcard
332
- end
333
-
334
- # After the change, the path matches.
335
- assert_equal "/wildcard/a%0Anewline", url_helpers.wildcard_path(wildcard_segment: "a\nnewline")
336
- ```
337
-
338
- Fixes #39103
339
-
340
- *Ignacio Chiazzo*
341
-
342
- * Treat html suffix in controller translation.
343
-
344
- *Rui Onodera*, *Gavin Miller*
345
-
346
- * Allow permitting numeric params.
74
+ class SessionsController < ApplicationController
75
+ rate_limit to: 10, within: 3.minutes, only: :create
76
+ end
347
77
 
348
- Previously it was impossible to permit different fields on numeric parameters.
349
- After this change you can specify different fields for each numbered parameter.
350
- For example params like,
351
- ```ruby
352
- book: {
353
- authors_attributes: {
354
- '0': { name: "William Shakespeare", age_of_death: "52" },
355
- '1': { name: "Unattributed Assistant" },
356
- '2': "Not a hash",
357
- 'new_record': { name: "Some name" }
358
- }
359
- }
78
+ class SignupsController < ApplicationController
79
+ rate_limit to: 1000, within: 10.seconds,
80
+ by: -> { request.domain }, with: -> { redirect_to busy_controller_url, alert: "Too many signups!" }, only: :new
81
+ end
360
82
  ```
361
83
 
362
- Before you could permit name on each author with,
363
- `permit book: { authors_attributes: [ :name ] }`
364
-
365
- After this change you can permit different keys on each numbered element,
366
- `permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
367
-
368
- Fixes #41625
369
-
370
- *Adam Hess*
371
-
372
- * Update `HostAuthorization` middleware to render debug info only
373
- when `config.consider_all_requests_local` is set to true.
374
-
375
- Also, blocked host info is always logged with level `error`.
376
-
377
- Fixes #42813
378
-
379
- *Nikita Vyrko*
380
-
381
- * Add Server-Timing middleware
382
-
383
- Server-Timing specification defines how the server can communicate to browsers performance metrics
384
- about the request it is responding to.
385
-
386
- The ServerTiming middleware is enabled by default on `development` environment by default using the
387
- `config.server_timing` setting and set the relevant duration metrics in the `Server-Timing` header
388
-
389
- The full specification for Server-Timing header can be found in: https://www.w3.org/TR/server-timing/#dfn-server-timing-header-field
390
-
391
- *Sebastian Sogamoso*, *Guillermo Iguaran*
392
-
393
-
394
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
395
-
396
- * No changes.
397
-
398
-
399
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
400
-
401
- * Use a static error message when raising `ActionDispatch::Http::Parameters::ParseError`
402
- to avoid inadvertently logging the HTTP request body at the `fatal` level when it contains
403
- malformed JSON.
404
-
405
- Fixes #41145
406
-
407
- *Aaron Lahey*
408
-
409
- * Add `Middleware#delete!` to delete middleware or raise if not found.
410
-
411
- `Middleware#delete!` works just like `Middleware#delete` but will
412
- raise an error if the middleware isn't found.
413
-
414
- *Alex Ghiculescu*, *Petrik de Heus*, *Junichi Sato*
415
-
416
- * Raise error on unpermitted open redirects.
417
-
418
- Add `allow_other_host` options to `redirect_to`.
419
- Opt in to this behaviour with `ActionController::Base.raise_on_open_redirects = true`.
420
-
421
- *Gannon McGibbon*
422
-
423
- * Deprecate `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1). Add `cuprite` instead.
424
-
425
- [Poltergeist](https://github.com/teampoltergeist/poltergeist) and [capybara-webkit](https://github.com/thoughtbot/capybara-webkit) are already not maintained. These usage in Rails are removed for avoiding confusing users.
426
-
427
- [Cuprite](https://github.com/rubycdp/cuprite) is a good alternative to Poltergeist. Some guide descriptions are replaced from Poltergeist to Cuprite.
428
-
429
- *Yusuke Iwaki*
430
-
431
- * Exclude additional flash types from `ActionController::Base.action_methods`.
432
-
433
- Ensures that additional flash types defined on ActionController::Base subclasses
434
- are not listed as actions on that controller.
435
-
436
- class MyController < ApplicationController
437
- add_flash_types :hype
438
- end
439
-
440
- MyController.action_methods.include?('hype') # => false
441
-
442
- *Gavin Morrice*
443
-
444
- * OpenSSL constants are now used for Digest computations.
445
-
446
- *Dirkjan Bussink*
447
-
448
- * Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module.
449
-
450
- Due to the age of those versions of IE this fix is no longer relevant, more importantly it creates an edge-case for unexpected Cache-Control headers.
451
-
452
- *Tadas Sasnauskas*
453
-
454
- * Configuration setting to skip logging an uncaught exception backtrace when the exception is
455
- present in `rescued_responses`.
84
+ *DHH*, *Jean Boussier*
456
85
 
457
- It may be too noisy to get all backtraces logged for applications that manage uncaught
458
- exceptions via `rescued_responses` and `exceptions_app`.
459
- `config.action_dispatch.log_rescued_responses` (defaults to `true`) can be set to `false` in
460
- this case, so that only exceptions not found in `rescued_responses` will be logged.
86
+ * Add `image/svg+xml` to the compressible content types of `ActionDispatch::Static`.
461
87
 
462
- *Alexander Azarov*, *Mike Dalessio*
88
+ *Georg Ledermann*
463
89
 
464
- * Ignore file fixtures on `db:fixtures:load`.
90
+ * Add instrumentation for `ActionController::Live#send_stream`.
465
91
 
466
- *Kevin Sjöberg*
92
+ Allows subscribing to `send_stream` events. The event payload contains the filename, disposition, and type.
467
93
 
468
- * Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
94
+ *Hannah Ramadan*
469
95
 
470
- *Dylan Thacker-Smith*
471
-
472
- * New `ActionController::ConditionalGet#no_store` method to set HTTP cache control `no-store` directive.
473
-
474
- *Tadas Sasnauskas*
475
-
476
- * Drop support for the `SERVER_ADDR` header.
477
-
478
- Following up https://github.com/rack/rack/pull/1573 and https://github.com/rails/rails/pull/42349.
479
-
480
- *Ricardo Díaz*
481
-
482
- * Set session options when initializing a basic session.
96
+ * Add support for `with_routing` test helper in `ActionDispatch::IntegrationTest`.
483
97
 
484
98
  *Gannon McGibbon*
485
99
 
486
- * Add `cache_control: {}` option to `fresh_when` and `stale?`.
487
-
488
- Works as a shortcut to set `response.cache_control` with the above methods.
489
-
490
- *Jacopo Beschi*
491
-
492
- * Writing into a disabled session will now raise an error.
493
-
494
- Previously when no session store was set, writing into the session would silently fail.
495
-
496
- *Jean Boussier*
497
-
498
- * Add support for 'require-trusted-types-for' and 'trusted-types' headers.
499
-
500
- Fixes #42034.
501
-
502
- *lfalcao*
503
-
504
- * Remove inline styles and address basic accessibility issues on rescue templates.
100
+ * Remove deprecated support to set `Rails.application.config.action_dispatch.show_exceptions` to `true` and `false`.
505
101
 
506
- *Jacob Herrington*
507
-
508
- * Add support for 'private, no-store' Cache-Control headers.
509
-
510
- Previously, 'no-store' was exclusive; no other directives could be specified.
511
-
512
- *Alex Smith*
513
-
514
- * Expand payload of `unpermitted_parameters.action_controller` instrumentation to allow subscribers to
515
- know which controller action received unpermitted parameters.
516
-
517
- *bbuchalter*
518
-
519
- * Add `ActionController::Live#send_stream` that makes it more convenient to send generated streams:
520
-
521
- ```ruby
522
- send_stream(filename: "subscribers.csv") do |stream|
523
- stream.writeln "email_address,updated_at"
524
-
525
- @subscribers.find_each do |subscriber|
526
- stream.writeln [ subscriber.email_address, subscriber.updated_at ].join(",")
527
- end
528
- end
529
- ```
530
-
531
- *DHH*
532
-
533
- * Add `ActionController::Live::Buffer#writeln` to write a line to the stream with a newline included.
534
-
535
- *DHH*
536
-
537
- * `ActionDispatch::Request#content_type` now returned Content-Type header as it is.
538
-
539
- Previously, `ActionDispatch::Request#content_type` returned value does NOT contain charset part.
540
- This behavior changed to returned Content-Type header containing charset part as it is.
102
+ *Rafael Mendonça França*
541
103
 
542
- If you want just MIME type, please use `ActionDispatch::Request#media_type` instead.
104
+ * Remove deprecated `speaker`, `vibrate`, and `vr` permissions policy directives.
543
105
 
544
- Before:
106
+ *Rafael Mendonça França*
545
107
 
546
- ```ruby
547
- request = ActionDispatch::Request.new("CONTENT_TYPE" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
548
- request.content_type #=> "text/csv"
549
- ```
108
+ * Remove deprecated `Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type`.
550
109
 
551
- After:
110
+ *Rafael Mendonça França*
552
111
 
553
- ```ruby
554
- request = ActionDispatch::Request.new("Content-Type" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
555
- request.content_type #=> "text/csv; header=present; charset=utf-16"
556
- request.media_type #=> "text/csv"
557
- ```
112
+ * Deprecate `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.
558
113
 
559
114
  *Rafael Mendonça França*
560
115
 
561
- * Change `ActionDispatch::Request#media_type` to return `nil` when the request don't have a `Content-Type` header.
116
+ * Remove deprecated comparison between `ActionController::Parameters` and `Hash`.
562
117
 
563
118
  *Rafael Mendonça França*
564
119
 
565
- * Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
120
+ * Remove deprecated constant `AbstractController::Helpers::MissingHelperError`.
566
121
 
567
- *Janko Marohnić*
122
+ *Rafael Mendonça França*
568
123
 
569
- * Allow anything with `#to_str` (like `Addressable::URI`) as a `redirect_to` location.
124
+ * Fix a race condition that could cause a `Text file busy - chromedriver`
125
+ error with parallel system tests.
570
126
 
571
- *ojab*
127
+ *Matt Brictson*
572
128
 
573
- * Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
129
+ * Add `racc` as a dependency since it will become a bundled gem in Ruby 3.4.0
574
130
 
575
- *Alex Robbin*
131
+ *Hartley McGuire*
132
+ * Remove deprecated constant `ActionDispatch::IllegalStateError`.
576
133
 
577
- * Deprecate the ability to assign a single value to `config.action_dispatch.trusted_proxies`
578
- as `RemoteIp` middleware behaves inconsistently depending on whether this is configured
579
- with a single value or an enumerable.
134
+ *Rafael Mendonça França*
580
135
 
581
- Fixes #40772.
136
+ * Add parameter filter capability for redirect locations.
582
137
 
583
- *Christian Sutter*
138
+ It uses the `config.filter_parameters` to match what needs to be filtered.
139
+ The result would be like this:
584
140
 
585
- * Add `redirect_back_or_to(fallback_location, **)` as a more aesthetically pleasing version of `redirect_back fallback_location:, **`.
586
- The old method name is retained without explicit deprecation.
141
+ Redirected to http://secret.foo.bar?username=roque&password=[FILTERED]
587
142
 
588
- *DHH*
143
+ Fixes #14055.
589
144
 
145
+ *Roque Pinel*, *Trevor Turk*, *tonytonyjan*
590
146
 
591
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md) for previous changes.
147
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actionpack/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2022 David Heinemeier Hansson
1
+ Copyright (c) David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the