actionpack 7.2.4 → 8.0.5.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +274 -125
- data/lib/abstract_controller/rendering.rb +0 -1
- data/lib/action_controller/base.rb +1 -1
- data/lib/action_controller/form_builder.rb +3 -3
- data/lib/action_controller/metal/allow_browser.rb +11 -1
- data/lib/action_controller/metal/conditional_get.rb +5 -1
- data/lib/action_controller/metal/data_streaming.rb +4 -2
- data/lib/action_controller/metal/instrumentation.rb +1 -2
- data/lib/action_controller/metal/live.rb +68 -14
- data/lib/action_controller/metal/rate_limiting.rb +13 -4
- data/lib/action_controller/metal/renderers.rb +2 -3
- data/lib/action_controller/metal/rendering.rb +9 -2
- data/lib/action_controller/metal/streaming.rb +5 -84
- data/lib/action_controller/metal/strong_parameters.rb +293 -97
- data/lib/action_controller/railtie.rb +6 -7
- data/lib/action_controller/test_case.rb +12 -2
- data/lib/action_dispatch/http/cache.rb +27 -10
- data/lib/action_dispatch/http/content_security_policy.rb +14 -1
- data/lib/action_dispatch/http/mime_negotiation.rb +11 -1
- data/lib/action_dispatch/http/param_builder.rb +186 -0
- data/lib/action_dispatch/http/param_error.rb +26 -0
- data/lib/action_dispatch/http/permissions_policy.rb +2 -0
- data/lib/action_dispatch/http/query_parser.rb +53 -0
- data/lib/action_dispatch/http/request.rb +60 -16
- data/lib/action_dispatch/http/response.rb +34 -13
- data/lib/action_dispatch/journey/parser.rb +99 -196
- data/lib/action_dispatch/journey/scanner.rb +44 -42
- data/lib/action_dispatch/middleware/cookies.rb +20 -3
- data/lib/action_dispatch/middleware/debug_exceptions.rb +16 -3
- data/lib/action_dispatch/middleware/debug_view.rb +0 -5
- data/lib/action_dispatch/middleware/exception_wrapper.rb +0 -6
- data/lib/action_dispatch/middleware/request_id.rb +2 -1
- data/lib/action_dispatch/middleware/session/abstract_store.rb +5 -0
- data/lib/action_dispatch/middleware/session/cache_store.rb +26 -3
- data/lib/action_dispatch/middleware/session/cookie_store.rb +0 -3
- data/lib/action_dispatch/middleware/ssl.rb +13 -3
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +0 -3
- data/lib/action_dispatch/railtie.rb +8 -0
- data/lib/action_dispatch/request/session.rb +1 -0
- data/lib/action_dispatch/request/utils.rb +9 -3
- data/lib/action_dispatch/routing/inspector.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +91 -62
- data/lib/action_dispatch/routing/polymorphic_routes.rb +2 -2
- data/lib/action_dispatch/routing/route_set.rb +21 -10
- data/lib/action_dispatch/routing/routes_proxy.rb +1 -0
- data/lib/action_dispatch/system_testing/browser.rb +12 -21
- data/lib/action_dispatch/testing/assertions/response.rb +12 -2
- data/lib/action_dispatch/testing/assertions/routing.rb +16 -12
- data/lib/action_dispatch/testing/integration.rb +18 -7
- data/lib/action_dispatch.rb +6 -4
- data/lib/action_pack/gem_version.rb +4 -4
- metadata +14 -47
- data/lib/action_dispatch/journey/parser.y +0 -50
- data/lib/action_dispatch/journey/parser_extras.rb +0 -33
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b2135f13807ec1b81f58b821d0110dbb0ffc66eff77788b8fcec4ae9a74cf0e
|
|
4
|
+
data.tar.gz: 8f6f0efcbe740bd97d66e1fd463ac31fc71a13602b5c3716619050be4dab0363
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e382f4f372105c75eab3eb57e4bbc651eb75895b7f820f2a38bcdb5c1eef5ca2ea7291ac70751f843f2727956dce4b5f2ee875fc77e3f6356f645d411d49bb0
|
|
7
|
+
data.tar.gz: d27b6d307f70376ba5ad40a90a2e684203973c98e5bd9f975750a415aac7edd737d3a8e3c2f9af3b7d84a7528fbfb5aa4928cb606922b3d6d3d0c1f838533542
|
data/CHANGELOG.md
CHANGED
|
@@ -1,27 +1,142 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 8.0.5.2 (November 03, 2026) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
|
|
3
|
+
* Apply `config.action_dispatch.cookies_same_site_protection` to every session
|
|
4
|
+
store.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`ActionDispatch::Session::CacheStore`, `MemCacheStore` and third-party
|
|
7
|
+
stores built on `AbstractStore` or the session mixins sent session cookies
|
|
8
|
+
with no `SameSite` attribute. Only `CookieStore` applied the configured
|
|
9
|
+
default.
|
|
7
10
|
|
|
11
|
+
[GHSA-gmj8-hvj3-49mw]
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
*Jean Boussier*
|
|
14
|
+
|
|
15
|
+
* Prevent `ActionController::Live` streams from blocking when a full buffer is
|
|
16
|
+
closed or aborted.
|
|
17
|
+
|
|
18
|
+
[GHSA-rwvh-fw6r-pwvp]
|
|
19
|
+
|
|
20
|
+
*Jeremy Daer*
|
|
21
|
+
|
|
22
|
+
* Set and extend the `Vary` header for rendered responses according to the
|
|
23
|
+
request headers used in format negotiation.
|
|
24
|
+
|
|
25
|
+
`Vary: Accept` was only added when the request carried a usable `Accept`
|
|
26
|
+
header. A response to a request without one, negotiated to HTML or
|
|
27
|
+
JavaScript, could be stored by a shared cache and served to later clients
|
|
28
|
+
that requested a different representation.
|
|
29
|
+
|
|
30
|
+
Responses now vary on `Accept` and `X-Requested-With` whenever the format is
|
|
31
|
+
not given by the URL. XHR requests without `Accept` also vary on
|
|
32
|
+
`Content-Type`, which Rails uses as a legacy format fallback. When
|
|
33
|
+
`config.action_dispatch.ignore_accept_header` is enabled, responses vary
|
|
34
|
+
only on `X-Requested-With`.
|
|
35
|
+
|
|
36
|
+
These fields are appended to an existing `Vary` value without duplicating
|
|
37
|
+
fields case-insensitively. `Vary: *` remains unchanged.
|
|
38
|
+
|
|
39
|
+
[GHSA-r9jg-fmfx-2gv6]
|
|
40
|
+
|
|
41
|
+
*Jeremy Daer*
|
|
42
|
+
|
|
43
|
+
* Skip writing a `CacheStore` session that another request deleted while this
|
|
44
|
+
one ran.
|
|
45
|
+
|
|
46
|
+
A request that loaded a session from `ActionDispatch::Session::CacheStore`
|
|
47
|
+
wrote it back when it finished, even after a concurrent `reset_session` or a
|
|
48
|
+
server-side delete had removed it, so the old session ID worked again.
|
|
49
|
+
|
|
50
|
+
[GHSA-2586-8ghr-69fj]
|
|
51
|
+
|
|
52
|
+
*Mike Dalessio*
|
|
53
|
+
|
|
54
|
+
* Don't write upgraded cookies to a response that skips the session.
|
|
55
|
+
|
|
56
|
+
Reading a signed or encrypted cookie written under a rotated secret, or in
|
|
57
|
+
the format a `:hybrid` serializer migrates from, writes it back in the
|
|
58
|
+
current format. That write ignored `request.session_options[:skip]`, so a
|
|
59
|
+
response that skips the session, such as the Active Storage proxy's
|
|
60
|
+
public, cacheable response, could still carry the session cookie in
|
|
61
|
+
`Set-Cookie`. Such a response now leaves the cookie unchanged, and a later
|
|
62
|
+
request that does not skip the session upgrades it. An application that
|
|
63
|
+
skips the session on every request no longer upgrades its signed or
|
|
64
|
+
encrypted cookies. Cookies the application sets are still written.
|
|
65
|
+
|
|
66
|
+
[GHSA-x6mj-8jx9-qhqv]
|
|
67
|
+
|
|
68
|
+
*Mike Dalessio*
|
|
69
|
+
|
|
70
|
+
* `ActionController::Parameters#each_key` returns `self` when given a block.
|
|
71
|
+
|
|
72
|
+
It returned the internal `ActiveSupport::HashWithIndifferentAccess`, which
|
|
73
|
+
does not respond to `permitted?`, so passing that return value to mass
|
|
74
|
+
assignment skipped the Strong Parameters check. `each`, `each_pair` and
|
|
75
|
+
`each_value` already return `self`.
|
|
76
|
+
|
|
77
|
+
Document that `ActionController::Parameters#as_json` returns every
|
|
78
|
+
parameter, permitted or not, in a hash that mass assignment does not check.
|
|
79
|
+
|
|
80
|
+
[GHSA-wm3x-v3qw-4jh3]
|
|
81
|
+
|
|
82
|
+
*Mike Dalessio*
|
|
83
|
+
|
|
84
|
+
## Rails 8.0.5.1 (July 29, 2026) ##
|
|
10
85
|
|
|
11
86
|
* No changes.
|
|
12
87
|
|
|
13
88
|
|
|
14
|
-
## Rails
|
|
89
|
+
## Rails 8.0.5 (March 24, 2026) ##
|
|
90
|
+
|
|
91
|
+
* Add `config.action_controller.live_streaming_excluded_keys` to control execution state sharing in ActionController::Live.
|
|
92
|
+
|
|
93
|
+
When using ActionController::Live, actions are executed in a separate thread that shares
|
|
94
|
+
state from the parent thread. This new configuration allows applications to opt-out specific
|
|
95
|
+
state keys that should not be shared.
|
|
96
|
+
|
|
97
|
+
This is useful when streaming inside a `connected_to` block, where you may want
|
|
98
|
+
the streaming thread to use its own database connection context.
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
# config/application.rb
|
|
102
|
+
config.action_controller.live_streaming_excluded_keys = [:active_record_connected_to_stack]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
By default, all keys are shared.
|
|
106
|
+
|
|
107
|
+
*Eileen M. Uchitelle*
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Rails 8.0.4.1 (March 23, 2026) ##
|
|
15
111
|
|
|
16
112
|
* No changes.
|
|
17
113
|
|
|
18
114
|
|
|
19
|
-
## Rails
|
|
115
|
+
## Rails 8.0.4 (October 28, 2025) ##
|
|
20
116
|
|
|
21
117
|
* Submit test requests using `as: :html` with `Content-Type: x-www-form-urlencoded`
|
|
22
118
|
|
|
23
119
|
*Sean Doyle*
|
|
24
120
|
|
|
121
|
+
|
|
122
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
|
123
|
+
|
|
124
|
+
* URL helpers for engines mounted at the application root handle `SCRIPT_NAME` correctly.
|
|
125
|
+
|
|
126
|
+
Fixed an issue where `SCRIPT_NAME` is not applied to paths generated for routes in an engine
|
|
127
|
+
mounted at "/".
|
|
128
|
+
|
|
129
|
+
*Mike Dalessio*
|
|
130
|
+
|
|
131
|
+
* Fix `Rails.application.reload_routes!` from clearing almost all routes.
|
|
132
|
+
|
|
133
|
+
When calling `Rails.application.reload_routes!` inside a middleware of
|
|
134
|
+
a Rake task, it was possible under certain conditions that all routes would be cleared.
|
|
135
|
+
If ran inside a middleware, this would result in getting a 404 on most page you visit.
|
|
136
|
+
This issue was only happening in development.
|
|
137
|
+
|
|
138
|
+
*Edouard Chin*
|
|
139
|
+
|
|
25
140
|
* Address `rack 3.2` deprecations warnings.
|
|
26
141
|
|
|
27
142
|
```
|
|
@@ -29,10 +144,14 @@
|
|
|
29
144
|
Please use :unprocessable_content instead.
|
|
30
145
|
```
|
|
31
146
|
|
|
32
|
-
Rails API will transparently convert one into the other for the
|
|
147
|
+
Rails API will transparently convert one into the other for the foreseeable future.
|
|
33
148
|
|
|
34
149
|
*Earlopain*, *Jean Boussier*
|
|
35
150
|
|
|
151
|
+
* Support hash-source in Content Security Policy.
|
|
152
|
+
|
|
153
|
+
*madogiwa*
|
|
154
|
+
|
|
36
155
|
* Always return empty body for HEAD requests in `PublicExceptions` and
|
|
37
156
|
`DebugExceptions`.
|
|
38
157
|
|
|
@@ -40,218 +159,248 @@
|
|
|
40
159
|
|
|
41
160
|
*Hartley McGuire*
|
|
42
161
|
|
|
43
|
-
* Fix `url_for` to handle `:path_params` gracefully when it's not a `Hash`.
|
|
44
162
|
|
|
45
|
-
|
|
163
|
+
## Rails 8.0.2.1 (August 13, 2025) ##
|
|
46
164
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* Fix `ActionDispatch::Executor` to unwrap exceptions like other error reporting middlewares.
|
|
165
|
+
* No changes.
|
|
50
166
|
|
|
51
|
-
|
|
167
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
|
52
168
|
|
|
53
|
-
*
|
|
169
|
+
* Improve `with_routing` test helper to not rebuild the middleware stack.
|
|
54
170
|
|
|
55
|
-
|
|
171
|
+
Otherwise some middleware configuration could be lost.
|
|
56
172
|
|
|
57
|
-
*
|
|
173
|
+
*Édouard Chin*
|
|
58
174
|
|
|
59
|
-
|
|
175
|
+
* Add resource name to the `ArgumentError` that's raised when invalid `:only` or `:except` options are given to `#resource` or `#resources`
|
|
60
176
|
|
|
177
|
+
This makes it easier to locate the source of the problem, especially for routes drawn by gems.
|
|
61
178
|
|
|
62
|
-
|
|
179
|
+
Before:
|
|
180
|
+
```
|
|
181
|
+
:only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
|
|
182
|
+
```
|
|
63
183
|
|
|
64
|
-
|
|
184
|
+
After:
|
|
185
|
+
```
|
|
186
|
+
Route `resources :products` - :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
|
|
187
|
+
```
|
|
65
188
|
|
|
189
|
+
*Jeremy Green*
|
|
66
190
|
|
|
67
|
-
|
|
191
|
+
* Fix `url_for` to handle `:path_params` gracefully when it's not a `Hash`.
|
|
68
192
|
|
|
69
|
-
|
|
70
|
-
Developers should use multiple arguments, and different directive methods instead.
|
|
193
|
+
Prevents various security scanners from causing exceptions.
|
|
71
194
|
|
|
72
|
-
|
|
195
|
+
*Martin Emde*
|
|
73
196
|
|
|
74
|
-
|
|
197
|
+
* Fix `ActionDispatch::Executor` to unwrap exceptions like other error reporting middlewares.
|
|
75
198
|
|
|
199
|
+
*Jean Boussier*
|
|
76
200
|
|
|
77
|
-
## Rails 7.2.2 (October 30, 2024) ##
|
|
78
201
|
|
|
79
|
-
|
|
202
|
+
## Rails 8.0.1 (December 13, 2024) ##
|
|
80
203
|
|
|
81
|
-
|
|
204
|
+
* Add `ActionDispatch::Request::Session#store` method to conform Rack spec.
|
|
82
205
|
|
|
206
|
+
*Yaroslav*
|
|
83
207
|
|
|
84
|
-
## Rails 7.2.1.2 (October 23, 2024) ##
|
|
85
208
|
|
|
86
|
-
|
|
209
|
+
## Rails 8.0.0.1 (December 10, 2024) ##
|
|
87
210
|
|
|
211
|
+
* Add validation to content security policies to disallow spaces and semicolons.
|
|
212
|
+
Developers should use multiple arguments, and different directive methods instead.
|
|
88
213
|
|
|
89
|
-
|
|
214
|
+
[CVE-2024-54133]
|
|
90
215
|
|
|
91
|
-
*
|
|
216
|
+
*Gannon McGibbon*
|
|
92
217
|
|
|
93
|
-
[CVE-2024-47887]
|
|
94
218
|
|
|
95
|
-
|
|
219
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
|
96
220
|
|
|
97
|
-
*
|
|
221
|
+
* No changes.
|
|
98
222
|
|
|
99
|
-
[CVE-2024-41128]
|
|
100
223
|
|
|
101
|
-
|
|
224
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
|
102
225
|
|
|
226
|
+
* Fix routes with `::` in the path.
|
|
103
227
|
|
|
104
|
-
|
|
228
|
+
*Rafael Mendonça França*
|
|
105
229
|
|
|
106
|
-
*
|
|
230
|
+
* Maintain Rack 2 parameter parsing behaviour.
|
|
107
231
|
|
|
108
|
-
*
|
|
232
|
+
*Matthew Draper*
|
|
109
233
|
|
|
110
234
|
|
|
111
|
-
## Rails
|
|
235
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
|
112
236
|
|
|
113
|
-
*
|
|
237
|
+
* Remove `Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality`.
|
|
114
238
|
|
|
115
|
-
*
|
|
239
|
+
*Rafael Mendonça França*
|
|
116
240
|
|
|
117
|
-
*
|
|
118
|
-
[CVE-2024-28103]
|
|
241
|
+
* Improve `ActionController::TestCase` to expose a binary encoded `request.body`.
|
|
119
242
|
|
|
120
|
-
|
|
243
|
+
The rack spec clearly states:
|
|
121
244
|
|
|
122
|
-
|
|
245
|
+
> The input stream is an IO-like object which contains the raw HTTP POST data.
|
|
246
|
+
> When applicable, its external encoding must be “ASCII-8BIT” and it must be opened in binary mode.
|
|
123
247
|
|
|
124
|
-
|
|
248
|
+
Until now its encoding was generally UTF-8, which doesn't accurately reflect production
|
|
249
|
+
behavior.
|
|
125
250
|
|
|
126
|
-
*
|
|
127
|
-
suggested correct location for the missing template.
|
|
251
|
+
*Jean Boussier*
|
|
128
252
|
|
|
129
|
-
|
|
253
|
+
* Update `ActionController::AllowBrowser` to support passing method names to `:block`
|
|
130
254
|
|
|
131
|
-
|
|
255
|
+
```ruby
|
|
256
|
+
class ApplicationController < ActionController::Base
|
|
257
|
+
allow_browser versions: :modern, block: :handle_outdated_browser
|
|
132
258
|
|
|
133
|
-
|
|
134
|
-
|
|
259
|
+
private
|
|
260
|
+
def handle_outdated_browser
|
|
261
|
+
render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
```
|
|
135
265
|
|
|
136
|
-
*
|
|
266
|
+
*Sean Doyle*
|
|
137
267
|
|
|
138
|
-
*
|
|
268
|
+
* Raise an `ArgumentError` when invalid `:only` or `:except` options are passed into `#resource` and `#resources`.
|
|
139
269
|
|
|
140
|
-
|
|
141
|
-
Rails.application.routes.draw do
|
|
142
|
-
controller :home do
|
|
143
|
-
get "recent", to: "recent_posts"
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
```
|
|
270
|
+
*Joshua Young*
|
|
147
271
|
|
|
148
|
-
|
|
272
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
|
149
273
|
|
|
150
|
-
*
|
|
274
|
+
* Fix non-GET requests not updating cookies in `ActionController::TestCase`.
|
|
151
275
|
|
|
152
|
-
*
|
|
276
|
+
*Jon Moss*, *Hartley McGuire*
|
|
153
277
|
|
|
154
|
-
*
|
|
278
|
+
* Update `ActionController::Live` to use a thread-pool to reuse threads across requests.
|
|
155
279
|
|
|
156
|
-
*
|
|
280
|
+
*Adam Renberg Tamm*
|
|
157
281
|
|
|
158
|
-
*
|
|
282
|
+
* Introduce safer, more explicit params handling method with `params#expect` such that
|
|
283
|
+
`params.expect(table: [ :attr ])` replaces `params.require(:table).permit(:attr)`
|
|
159
284
|
|
|
160
|
-
|
|
285
|
+
Ensures params are filtered with consideration for the expected
|
|
286
|
+
types of values, improving handling of params and avoiding ignorable
|
|
287
|
+
errors caused by params tampering.
|
|
161
288
|
|
|
162
289
|
```ruby
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
290
|
+
# If the url is altered to ?person=hacked
|
|
291
|
+
# Before
|
|
292
|
+
params.require(:person).permit(:name, :age, pets: [:name])
|
|
293
|
+
# raises NoMethodError, causing a 500 and potential error reporting
|
|
294
|
+
|
|
295
|
+
# After
|
|
296
|
+
params.expect(person: [ :name, :age, pets: [[:name]] ])
|
|
297
|
+
# raises ActionController::ParameterMissing, correctly returning a 400 error
|
|
298
|
+
```
|
|
167
299
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
300
|
+
You may also notice the new double array `[[:name]]`. In order to
|
|
301
|
+
declare when a param is expected to be an array of parameter hashes,
|
|
302
|
+
this new double array syntax is used to explicitly declare an array.
|
|
303
|
+
`expect` requires you to declare expected arrays in this way, and will
|
|
304
|
+
ignore arrays that are passed when, for example, `pet: [:name]` is used.
|
|
172
305
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
end
|
|
177
|
-
```
|
|
306
|
+
In order to preserve compatibility, `permit` does not adopt the new
|
|
307
|
+
double array syntax and is therefore more permissive about unexpected
|
|
308
|
+
types. Using `expect` everywhere is recommended.
|
|
178
309
|
|
|
179
|
-
|
|
310
|
+
We suggest replacing `params.require(:person).permit(:name, :age)`
|
|
311
|
+
with the direct replacement `params.expect(person: [:name, :age])`
|
|
312
|
+
to prevent external users from manipulating params to trigger 500
|
|
313
|
+
errors. A 400 error will be returned instead, using public/400.html
|
|
180
314
|
|
|
181
|
-
|
|
315
|
+
Usage of `params.require(:id)` should likewise be replaced with
|
|
316
|
+
`params.expect(:id)` which is designed to ensure that `params[:id]`
|
|
317
|
+
is a scalar and not an array or hash, also requiring the param.
|
|
182
318
|
|
|
183
319
|
```ruby
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
end
|
|
320
|
+
# Before
|
|
321
|
+
User.find(params.require(:id)) # allows an array, altering behavior
|
|
187
322
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
by: -> { request.domain }, with: -> { redirect_to busy_controller_url, alert: "Too many signups!" }, only: :new
|
|
191
|
-
end
|
|
323
|
+
# After
|
|
324
|
+
User.find(params.expect(:id)) # expect only returns non-blank permitted scalars (excludes Hash, Array, nil, "", etc)
|
|
192
325
|
```
|
|
193
326
|
|
|
194
|
-
*
|
|
327
|
+
*Martin Emde*
|
|
328
|
+
|
|
329
|
+
* System Testing: Disable Chrome's search engine choice by default in system tests.
|
|
195
330
|
|
|
196
|
-
*
|
|
331
|
+
*glaszig*
|
|
197
332
|
|
|
198
|
-
|
|
333
|
+
* Fix `Request#raw_post` raising `NoMethodError` when `rack.input` is `nil`.
|
|
199
334
|
|
|
200
|
-
*
|
|
335
|
+
*Hartley McGuire*
|
|
201
336
|
|
|
202
|
-
|
|
337
|
+
* Remove `racc` dependency by manually writing `ActionDispatch::Journey::Scanner`.
|
|
203
338
|
|
|
204
|
-
*
|
|
339
|
+
*Gannon McGibbon*
|
|
205
340
|
|
|
206
|
-
*
|
|
341
|
+
* Speed up `ActionDispatch::Routing::Mapper::Scope#[]` by merging frame hashes.
|
|
207
342
|
|
|
208
343
|
*Gannon McGibbon*
|
|
209
344
|
|
|
210
|
-
*
|
|
345
|
+
* Allow bots to ignore `allow_browser`.
|
|
211
346
|
|
|
212
|
-
*
|
|
347
|
+
*Matthew Nguyen*
|
|
213
348
|
|
|
214
|
-
*
|
|
349
|
+
* Deprecate drawing routes with multiple paths to make routing faster.
|
|
350
|
+
You may use `with_options` or a loop to make drawing multiple paths easier.
|
|
215
351
|
|
|
216
|
-
|
|
352
|
+
```ruby
|
|
353
|
+
# Before
|
|
354
|
+
get "/users", "/other_path", to: "users#index"
|
|
217
355
|
|
|
218
|
-
|
|
356
|
+
# After
|
|
357
|
+
get "/users", to: "users#index"
|
|
358
|
+
get "/other_path", to: "users#index"
|
|
359
|
+
```
|
|
219
360
|
|
|
220
|
-
*
|
|
361
|
+
*Gannon McGibbon*
|
|
221
362
|
|
|
222
|
-
*
|
|
363
|
+
* Make `http_cache_forever` use `immutable: true`
|
|
223
364
|
|
|
224
|
-
*
|
|
365
|
+
*Nate Matykiewicz*
|
|
225
366
|
|
|
226
|
-
*
|
|
367
|
+
* Add `config.action_dispatch.strict_freshness`.
|
|
227
368
|
|
|
228
|
-
|
|
369
|
+
When set to `true`, the `ETag` header takes precedence over the `Last-Modified` header when both are present,
|
|
370
|
+
as specified by RFC 7232, Section 6.
|
|
229
371
|
|
|
230
|
-
|
|
372
|
+
Defaults to `false` to maintain compatibility with previous versions of Rails, but is enabled as part of
|
|
373
|
+
Rails 8.0 defaults.
|
|
231
374
|
|
|
232
|
-
*
|
|
375
|
+
*heka1024*
|
|
233
376
|
|
|
234
|
-
*
|
|
235
|
-
error with parallel system tests.
|
|
377
|
+
* Support `immutable` directive in Cache-Control
|
|
236
378
|
|
|
237
|
-
|
|
379
|
+
```ruby
|
|
380
|
+
expires_in 1.minute, public: true, immutable: true
|
|
381
|
+
# Cache-Control: public, max-age=60, immutable
|
|
382
|
+
```
|
|
238
383
|
|
|
239
|
-
*
|
|
384
|
+
*heka1024*
|
|
240
385
|
|
|
241
|
-
|
|
242
|
-
* Remove deprecated constant `ActionDispatch::IllegalStateError`.
|
|
386
|
+
* Add `:wasm_unsafe_eval` mapping for `content_security_policy`
|
|
243
387
|
|
|
244
|
-
|
|
388
|
+
```ruby
|
|
389
|
+
# Before
|
|
390
|
+
policy.script_src "'wasm-unsafe-eval'"
|
|
391
|
+
|
|
392
|
+
# After
|
|
393
|
+
policy.script_src :wasm_unsafe_eval
|
|
394
|
+
```
|
|
245
395
|
|
|
246
|
-
*
|
|
396
|
+
*Joe Haig*
|
|
247
397
|
|
|
248
|
-
|
|
249
|
-
The result would be like this:
|
|
398
|
+
* Add `display_capture` and `keyboard_map` in `permissions_policy`
|
|
250
399
|
|
|
251
|
-
|
|
400
|
+
*Cyril Blaecke*
|
|
252
401
|
|
|
253
|
-
|
|
402
|
+
* Add `connect` route helper.
|
|
254
403
|
|
|
255
|
-
*
|
|
404
|
+
*Samuel Williams*
|
|
256
405
|
|
|
257
|
-
Please check [7-
|
|
406
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/actionpack/CHANGELOG.md) for previous changes.
|
|
@@ -266,7 +266,7 @@ module ActionController
|
|
|
266
266
|
ParamsWrapper
|
|
267
267
|
]
|
|
268
268
|
|
|
269
|
-
# Note: Documenting these severely
|
|
269
|
+
# Note: Documenting these severely degrades the performance of rdoc
|
|
270
270
|
# :stopdoc:
|
|
271
271
|
include AbstractController::Rendering
|
|
272
272
|
include AbstractController::Translation
|
|
@@ -22,10 +22,10 @@ module ActionController
|
|
|
22
22
|
# default_form_builder AdminFormBuilder
|
|
23
23
|
# end
|
|
24
24
|
#
|
|
25
|
-
# Then in the view any form using `form_for` will be an
|
|
26
|
-
# specified form builder:
|
|
25
|
+
# Then in the view any form using `form_with` or `form_for` will be an
|
|
26
|
+
# instance of the specified form builder:
|
|
27
27
|
#
|
|
28
|
-
# <%=
|
|
28
|
+
# <%= form_with(model: @instance) do |builder| %>
|
|
29
29
|
# <%= builder.special_field(:name) %>
|
|
30
30
|
# <% end %>
|
|
31
31
|
module FormBuilder
|
|
@@ -36,6 +36,16 @@ module ActionController # :nodoc:
|
|
|
36
36
|
# end
|
|
37
37
|
#
|
|
38
38
|
# class ApplicationController < ActionController::Base
|
|
39
|
+
# # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has
|
|
40
|
+
# allow_browser versions: :modern, block: :handle_outdated_browser
|
|
41
|
+
#
|
|
42
|
+
# private
|
|
43
|
+
# def handle_outdated_browser
|
|
44
|
+
# render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable
|
|
45
|
+
# end
|
|
46
|
+
# end
|
|
47
|
+
#
|
|
48
|
+
# class ApplicationController < ActionController::Base
|
|
39
49
|
# # 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+.
|
|
40
50
|
# allow_browser versions: { safari: 16.4, firefox: 121, ie: false }
|
|
41
51
|
# end
|
|
@@ -55,7 +65,7 @@ module ActionController # :nodoc:
|
|
|
55
65
|
|
|
56
66
|
if BrowserBlocker.new(request, versions: versions).blocked?
|
|
57
67
|
ActiveSupport::Notifications.instrument("browser_block.action_controller", request: request, versions: versions) do
|
|
58
|
-
instance_exec(&block)
|
|
68
|
+
block.is_a?(Symbol) ? send(block) : instance_exec(&block)
|
|
59
69
|
end
|
|
60
70
|
end
|
|
61
71
|
end
|
|
@@ -259,6 +259,9 @@ module ActionController
|
|
|
259
259
|
# `:stale_if_error`
|
|
260
260
|
# : Sets the value of the `stale-if-error` directive.
|
|
261
261
|
#
|
|
262
|
+
# `:immutable`
|
|
263
|
+
# : If true, adds the `immutable` directive.
|
|
264
|
+
#
|
|
262
265
|
#
|
|
263
266
|
# Any additional key-value pairs are concatenated as directives. For a list of
|
|
264
267
|
# supported `Cache-Control` directives, see the [article on
|
|
@@ -292,6 +295,7 @@ module ActionController
|
|
|
292
295
|
must_revalidate: options.delete(:must_revalidate),
|
|
293
296
|
stale_while_revalidate: options.delete(:stale_while_revalidate),
|
|
294
297
|
stale_if_error: options.delete(:stale_if_error),
|
|
298
|
+
immutable: options.delete(:immutable),
|
|
295
299
|
)
|
|
296
300
|
options.delete(:private)
|
|
297
301
|
|
|
@@ -315,7 +319,7 @@ module ActionController
|
|
|
315
319
|
# user's web browser. To allow proxies to cache the response, set `true` to
|
|
316
320
|
# indicate that they can serve the cached response to all users.
|
|
317
321
|
def http_cache_forever(public: false)
|
|
318
|
-
expires_in 100.years, public: public
|
|
322
|
+
expires_in 100.years, public: public, immutable: true
|
|
319
323
|
|
|
320
324
|
yield if stale?(etag: request.fullpath,
|
|
321
325
|
last_modified: Time.new(2011, 1, 1).utc,
|
|
@@ -28,7 +28,8 @@ module ActionController # :nodoc:
|
|
|
28
28
|
# `send_file(params[:path])` allows a malicious user to download any file on
|
|
29
29
|
# your server.
|
|
30
30
|
#
|
|
31
|
-
# Options:
|
|
31
|
+
# #### Options:
|
|
32
|
+
#
|
|
32
33
|
# * `:filename` - suggests a filename for the browser to use. Defaults to
|
|
33
34
|
# `File.basename(path)`.
|
|
34
35
|
# * `:type` - specifies an HTTP content type. You can specify either a string
|
|
@@ -90,7 +91,8 @@ module ActionController # :nodoc:
|
|
|
90
91
|
# inline data. You may also set the content type, the file name, and other
|
|
91
92
|
# things.
|
|
92
93
|
#
|
|
93
|
-
# Options:
|
|
94
|
+
# #### Options:
|
|
95
|
+
#
|
|
94
96
|
# * `:filename` - suggests a filename for the browser to use.
|
|
95
97
|
# * `:type` - specifies an HTTP content type. Defaults to
|
|
96
98
|
# `application/octet-stream`. You can specify either a string or a symbol
|