actionpack 6.1.4.1 → 7.0.0.alpha1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +101 -436
- data/MIT-LICENSE +1 -1
- data/README.rdoc +2 -3
- data/lib/abstract_controller/asset_paths.rb +1 -1
- data/lib/abstract_controller/base.rb +7 -21
- data/lib/abstract_controller/caching/fragments.rb +2 -2
- data/lib/abstract_controller/caching.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +9 -8
- data/lib/abstract_controller/collector.rb +4 -2
- data/lib/abstract_controller/error.rb +1 -1
- data/lib/abstract_controller/helpers.rb +3 -2
- data/lib/abstract_controller/logger.rb +1 -1
- data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
- data/lib/abstract_controller/translation.rb +0 -2
- data/lib/abstract_controller/url_for.rb +4 -6
- data/lib/action_controller/api.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +3 -1
- data/lib/action_controller/metal/conditional_get.rb +38 -1
- data/lib/action_controller/metal/content_security_policy.rb +1 -1
- data/lib/action_controller/metal/cookies.rb +1 -1
- data/lib/action_controller/metal/data_streaming.rb +5 -13
- data/lib/action_controller/metal/exceptions.rb +19 -30
- data/lib/action_controller/metal/flash.rb +6 -2
- data/lib/action_controller/metal/http_authentication.rb +15 -15
- data/lib/action_controller/metal/instrumentation.rb +55 -52
- data/lib/action_controller/metal/live.rb +42 -2
- data/lib/action_controller/metal/mime_responds.rb +3 -3
- data/lib/action_controller/metal/params_wrapper.rb +7 -7
- data/lib/action_controller/metal/permissions_policy.rb +1 -1
- data/lib/action_controller/metal/query_tags.rb +16 -0
- data/lib/action_controller/metal/redirecting.rb +50 -16
- data/lib/action_controller/metal/rendering.rb +7 -7
- data/lib/action_controller/metal/request_forgery_protection.rb +64 -20
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/streaming.rb +1 -3
- data/lib/action_controller/metal/strong_parameters.rb +24 -28
- data/lib/action_controller/metal/testing.rb +0 -2
- data/lib/action_controller/metal.rb +7 -10
- data/lib/action_controller/railtie.rb +42 -5
- data/lib/action_controller/test_case.rb +6 -2
- data/lib/action_controller.rb +2 -5
- data/lib/action_dispatch/http/cache.rb +13 -6
- data/lib/action_dispatch/http/content_security_policy.rb +39 -35
- data/lib/action_dispatch/http/filter_parameters.rb +5 -0
- data/lib/action_dispatch/http/mime_negotiation.rb +13 -3
- data/lib/action_dispatch/http/mime_type.rb +9 -11
- data/lib/action_dispatch/http/parameters.rb +4 -4
- data/lib/action_dispatch/http/permissions_policy.rb +1 -1
- data/lib/action_dispatch/http/request.rb +10 -19
- data/lib/action_dispatch/http/response.rb +3 -3
- data/lib/action_dispatch/http/url.rb +9 -10
- data/lib/action_dispatch/journey/gtg/builder.rb +11 -12
- data/lib/action_dispatch/journey/gtg/simulator.rb +10 -4
- data/lib/action_dispatch/journey/gtg/transition_table.rb +77 -21
- data/lib/action_dispatch/journey/nodes/node.rb +70 -5
- data/lib/action_dispatch/journey/path/pattern.rb +22 -13
- data/lib/action_dispatch/journey/route.rb +5 -12
- data/lib/action_dispatch/journey/router/utils.rb +2 -2
- data/lib/action_dispatch/journey/router.rb +1 -1
- data/lib/action_dispatch/journey/routes.rb +3 -3
- data/lib/action_dispatch/journey/visualizer/fsm.js +49 -24
- data/lib/action_dispatch/journey/visualizer/index.html.erb +1 -1
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +0 -1
- data/lib/action_dispatch/middleware/cookies.rb +7 -3
- data/lib/action_dispatch/middleware/debug_exceptions.rb +6 -4
- data/lib/action_dispatch/middleware/debug_locks.rb +3 -3
- data/lib/action_dispatch/middleware/exception_wrapper.rb +4 -0
- data/lib/action_dispatch/middleware/flash.rb +9 -11
- data/lib/action_dispatch/middleware/host_authorization.rb +1 -3
- data/lib/action_dispatch/middleware/remote_ip.rb +16 -4
- data/lib/action_dispatch/middleware/session/abstract_store.rb +1 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +7 -9
- data/lib/action_dispatch/middleware/stack.rb +50 -9
- data/lib/action_dispatch/middleware/static.rb +2 -5
- data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +4 -11
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +4 -4
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +28 -18
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +3 -3
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +5 -14
- data/lib/action_dispatch/railtie.rb +8 -2
- data/lib/action_dispatch/request/session.rb +43 -13
- data/lib/action_dispatch/routing/mapper.rb +44 -72
- data/lib/action_dispatch/routing/redirection.rb +0 -2
- data/lib/action_dispatch/routing/route_set.rb +9 -6
- data/lib/action_dispatch/routing/routes_proxy.rb +1 -1
- data/lib/action_dispatch/routing/url_for.rb +1 -2
- data/lib/action_dispatch/routing.rb +2 -2
- data/lib/action_dispatch/system_test_case.rb +5 -5
- data/lib/action_dispatch/system_testing/driver.rb +24 -4
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +10 -6
- data/lib/action_dispatch/testing/assertions.rb +2 -5
- data/lib/action_dispatch/testing/integration.rb +6 -8
- data/lib/action_dispatch/testing/test_process.rb +12 -9
- data/lib/action_dispatch.rb +1 -1
- data/lib/action_pack/gem_version.rb +4 -4
- data/lib/action_pack.rb +1 -1
- metadata +21 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0abf991e8448167804273ced78bacdd30f1893fee1faf3641957269a6f65b6a6
|
4
|
+
data.tar.gz: 2f2d0db3358796edfd2956c920f8db7f4a723bd0bb9b6736d8bd63f9bf67a200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28e7fa0e651362d6ff86a2f8caddbe321ee762a27485bae54436fa48283eaf2d8eb9f9c5bd118415b32a4859927f1868de8f2a7bcb78743a385a350f9c1ed3c2
|
7
|
+
data.tar.gz: fb6318f474b1f71365531af95711791568d68da4fb7de2796cb09254cabb8f7547819fbbf70193a08c7970680dadd51e036637a0bc184339504b7544e21b9c07
|
data/CHANGELOG.md
CHANGED
@@ -1,528 +1,193 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Use a static error message when raising `ActionDispatch::Http::Parameters::ParseError`
|
4
|
+
to avoid inadvertently logging the HTTP request body at the `fatal` level when it contains
|
5
|
+
malformed JSON.
|
4
6
|
|
5
|
-
|
6
|
-
"allowed host" formats can cause the Host Authorization middleware in Action
|
7
|
-
Pack to redirect users to a malicious website.
|
7
|
+
Fixes #41145
|
8
8
|
|
9
|
-
|
9
|
+
*Aaron Lahey*
|
10
10
|
|
11
|
-
*
|
11
|
+
* Add `Middleware#delete!` to delete middleware or raise if not found.
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
16
|
-
|
17
|
-
*Dylan Thacker-Smith*
|
18
|
-
|
19
|
-
* Correctly place optional path parameter booleans.
|
20
|
-
|
21
|
-
Previously, if you specify a url parameter that is part of the path as false it would include that part
|
22
|
-
of the path as parameter for example:
|
23
|
-
|
24
|
-
```
|
25
|
-
get "(/optional/:optional_id)/things" => "foo#foo", as: :things
|
26
|
-
things_path(optional_id: false) # => /things?optional_id=false
|
27
|
-
```
|
28
|
-
|
29
|
-
After this change, true and false will be treated the same when used as optional path parameters. Meaning now:
|
30
|
-
|
31
|
-
```
|
32
|
-
get '(this/:my_bool)/that' as: :that
|
33
|
-
|
34
|
-
that_path(my_bool: true) # => `/this/true/that`
|
35
|
-
that_path(my_bool: false) # => `/this/false/that`
|
36
|
-
```
|
37
|
-
|
38
|
-
*Adam Hess*
|
39
|
-
|
40
|
-
* Add support for 'private, no-store' Cache-Control headers.
|
41
|
-
|
42
|
-
Previously, 'no-store' was exclusive; no other directives could be specified.
|
43
|
-
|
44
|
-
*Alex Smith*
|
13
|
+
`Middleware#delete!` works just like `Middleware#delete` but will
|
14
|
+
raise an error if the middleware isn't found.
|
45
15
|
|
16
|
+
*Alex Ghiculescu*, *Petrik de Heus*, *Junichi Sato*
|
46
17
|
|
47
|
-
|
18
|
+
* Raise error on unpermitted open redirects.
|
48
19
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
* Prevent catastrophic backtracking during mime parsing
|
53
|
-
CVE-2021-22902
|
54
|
-
|
55
|
-
* Prevent regex DoS in HTTP token authentication
|
56
|
-
CVE-2021-22904
|
57
|
-
|
58
|
-
* Prevent string polymorphic route arguments.
|
59
|
-
|
60
|
-
`url_for` supports building polymorphic URLs via an array
|
61
|
-
of arguments (usually symbols and records). If a developer passes a
|
62
|
-
user input array, strings can result in unwanted route helper calls.
|
63
|
-
|
64
|
-
CVE-2021-22885
|
20
|
+
Add `allow_other_host` options to `redirect_to`.
|
21
|
+
Opt in to this behaviour with `ActionController::Base.raise_on_open_redirects = true`.
|
65
22
|
|
66
23
|
*Gannon McGibbon*
|
67
24
|
|
68
|
-
|
69
|
-
|
70
|
-
* No changes.
|
71
|
-
|
72
|
-
|
73
|
-
## Rails 6.1.3 (February 17, 2021) ##
|
74
|
-
|
75
|
-
* Re-define routes when not set correctly via inheritance.
|
76
|
-
|
77
|
-
*John Hawthorn*
|
78
|
-
|
79
|
-
|
80
|
-
## Rails 6.1.2.1 (February 10, 2021) ##
|
81
|
-
|
82
|
-
* Prevent open redirect when allowed host starts with a dot
|
83
|
-
|
84
|
-
[CVE-2021-22881]
|
85
|
-
|
86
|
-
Thanks to @tktech (https://hackerone.com/tktech) for reporting this
|
87
|
-
issue and the patch!
|
88
|
-
|
89
|
-
*Aaron Patterson*
|
90
|
-
|
91
|
-
|
92
|
-
## Rails 6.1.2 (February 09, 2021) ##
|
93
|
-
|
94
|
-
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
95
|
-
|
96
|
-
*Janko Marohnić*
|
97
|
-
|
98
|
-
* Fix `fixture_file_upload` deprecation when `file_fixture_path` is a relative path.
|
99
|
-
|
100
|
-
*Eugene Kenny*
|
101
|
-
|
102
|
-
|
103
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
104
|
-
|
105
|
-
* Fix nil translation key lookup in controllers/
|
25
|
+
* Deprecate `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1). Add `cuprite` instead.
|
106
26
|
|
107
|
-
|
27
|
+
[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.
|
108
28
|
|
109
|
-
|
29
|
+
[Cuprite](https://github.com/rubycdp/cuprite) is a good alternative to Poltergeist. Some guide descriptions are replaced from Poltergeist to Cuprite.
|
110
30
|
|
111
|
-
*
|
112
|
-
|
113
|
-
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
114
|
-
|
115
|
-
*Alex Robbin*
|
31
|
+
*Yusuke Iwaki*
|
116
32
|
|
33
|
+
* Exclude additional flash types from `ActionController::Base.action_methods`.
|
117
34
|
|
118
|
-
|
35
|
+
Ensures that additional flash types defined on ActionController::Base subclasses
|
36
|
+
are not listed as actions on that controller.
|
119
37
|
|
120
|
-
|
121
|
-
|
38
|
+
class MyController < ApplicationController
|
39
|
+
add_flash_types :hype
|
40
|
+
end
|
122
41
|
|
123
|
-
|
124
|
-
Rails.application.config.permissions_policy do |p|
|
125
|
-
p.camera :none
|
126
|
-
p.gyroscope :none
|
127
|
-
p.microphone :none
|
128
|
-
p.usb :none
|
129
|
-
p.fullscreen :self
|
130
|
-
p.payment :self, "https://secure-example.com"
|
131
|
-
end
|
132
|
-
```
|
42
|
+
MyController.action_methods.include?('hype') # => false
|
133
43
|
|
134
|
-
*
|
44
|
+
*Gavin Morrice*
|
135
45
|
|
136
|
-
*
|
46
|
+
* OpenSSL constants are now used for Digest computations.
|
137
47
|
|
138
|
-
|
48
|
+
*Dirkjan Bussink*
|
139
49
|
|
140
|
-
|
50
|
+
* Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module.
|
141
51
|
|
142
|
-
|
143
|
-
the unique X-Request-Id header
|
52
|
+
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.
|
144
53
|
|
145
|
-
*
|
54
|
+
*Tadas Sasnauskas*
|
146
55
|
|
147
|
-
*
|
56
|
+
* Configuration setting to skip logging an uncaught exception backtrace when the exception is
|
57
|
+
present in `rescued_responses`.
|
148
58
|
|
149
|
-
|
59
|
+
It may be too noisy to get all backtraces logged for applications that manage uncaught
|
60
|
+
exceptions via `rescued_responses` and `exceptions_app`.
|
61
|
+
`config.action_dispatch.log_rescued_responses` (defaults to `true`) can be set to `false` in
|
62
|
+
this case, so that only exceptions not found in `rescued_responses` will be logged.
|
150
63
|
|
151
|
-
*
|
64
|
+
*Alexander Azarov*, *Mike Dalessio*
|
152
65
|
|
153
|
-
|
66
|
+
* Ignore file fixtures on `db:fixtures:load`.
|
154
67
|
|
155
|
-
*
|
68
|
+
*Kevin Sjöberg*
|
156
69
|
|
157
|
-
|
70
|
+
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
158
71
|
|
159
|
-
*
|
72
|
+
*Dylan Thacker-Smith*
|
160
73
|
|
161
|
-
|
74
|
+
* New `ActionController::ConditionalGet#no_store` method to set HTTP cache control `no-store` directive.
|
162
75
|
|
163
|
-
*
|
76
|
+
*Tadas Sasnauskas*
|
164
77
|
|
165
|
-
*
|
78
|
+
* Drop support for the `SERVER_ADDR` header.
|
166
79
|
|
167
|
-
|
168
|
-
`ActionDispatch::Http::Request#POST` prior to validating encoding.
|
80
|
+
Following up https://github.com/rack/rack/pull/1573 and https://github.com/rails/rails/pull/42349.
|
169
81
|
|
170
|
-
*
|
82
|
+
*Ricardo Díaz*
|
171
83
|
|
172
|
-
*
|
84
|
+
* Set session options when initializing a basic session.
|
173
85
|
|
174
86
|
*Gannon McGibbon*
|
175
87
|
|
176
|
-
*
|
177
|
-
|
178
|
-
*Alan Tan*, *Oz Ben-David*
|
179
|
-
|
180
|
-
* Fix `follow_redirect!` to follow redirection with same HTTP verb when following
|
181
|
-
a 308 redirection.
|
182
|
-
|
183
|
-
*Alan Tan*
|
184
|
-
|
185
|
-
* When multiple domains are specified for a cookie, a domain will now be
|
186
|
-
chosen only if it is equal to or is a superdomain of the request host.
|
187
|
-
|
188
|
-
*Jonathan Hefner*
|
189
|
-
|
190
|
-
* `ActionDispatch::Static` handles precompiled Brotli (.br) files.
|
191
|
-
|
192
|
-
Adds to existing support for precompiled gzip (.gz) files.
|
193
|
-
Brotli files are preferred due to much better compression.
|
194
|
-
|
195
|
-
When the browser requests /some.js with `Accept-Encoding: br`,
|
196
|
-
we check for public/some.js.br and serve that file, if present, with
|
197
|
-
`Content-Encoding: br` and `Vary: Accept-Encoding` headers.
|
198
|
-
|
199
|
-
*Ryan Edward Hall*, *Jeremy Daer*
|
200
|
-
|
201
|
-
* Add raise_on_missing_translations support for controllers.
|
202
|
-
|
203
|
-
This configuration determines whether an error should be raised for missing translations.
|
204
|
-
It can be enabled through `config.i18n.raise_on_missing_translations`. Note that described
|
205
|
-
configuration also affects raising error for missing translations in views.
|
206
|
-
|
207
|
-
*fatkodima*
|
208
|
-
|
209
|
-
* Added `compact` and `compact!` to `ActionController::Parameters`.
|
210
|
-
|
211
|
-
*Eugene Kenny*
|
212
|
-
|
213
|
-
* Calling `each_pair` or `each_value` on an `ActionController::Parameters`
|
214
|
-
without passing a block now returns an enumerator.
|
215
|
-
|
216
|
-
*Eugene Kenny*
|
217
|
-
|
218
|
-
* `fixture_file_upload` now uses path relative to `file_fixture_path`
|
219
|
-
|
220
|
-
Previously the path had to be relative to `fixture_path`.
|
221
|
-
You can change your existing code as follow:
|
222
|
-
|
223
|
-
```ruby
|
224
|
-
# Before
|
225
|
-
fixture_file_upload('files/dog.png')
|
226
|
-
|
227
|
-
# After
|
228
|
-
fixture_file_upload('dog.png')
|
229
|
-
```
|
230
|
-
|
231
|
-
*Edouard Chin*
|
232
|
-
|
233
|
-
* Remove deprecated `force_ssl` at the controller level.
|
234
|
-
|
235
|
-
*Rafael Mendonça França*
|
236
|
-
|
237
|
-
* The +helper+ class method for controllers loads helper modules specified as
|
238
|
-
strings/symbols with `String#constantize` instead of `require_dependency`.
|
239
|
-
|
240
|
-
Remember that support for strings/symbols is only a convenient API. You can
|
241
|
-
always pass a module object:
|
242
|
-
|
243
|
-
```ruby
|
244
|
-
helper UtilsHelper
|
245
|
-
```
|
246
|
-
|
247
|
-
which is recommended because it is simple and direct. When a string/symbol
|
248
|
-
is received, `helper` just manipulates and inflects the argument to obtain
|
249
|
-
that same module object.
|
250
|
-
|
251
|
-
*Xavier Noria*, *Jean Boussier*
|
252
|
-
|
253
|
-
* Correctly identify the entire localhost IPv4 range as trusted proxy.
|
254
|
-
|
255
|
-
*Nick Soracco*
|
256
|
-
|
257
|
-
* `url_for` will now use "https://" as the default protocol when
|
258
|
-
`Rails.application.config.force_ssl` is set to true.
|
259
|
-
|
260
|
-
*Jonathan Hefner*
|
261
|
-
|
262
|
-
* Accept and default to base64_urlsafe CSRF tokens.
|
263
|
-
|
264
|
-
Base64 strict-encoded CSRF tokens are not inherently websafe, which makes
|
265
|
-
them difficult to deal with. For example, the common practice of sending
|
266
|
-
the CSRF token to a browser in a client-readable cookie does not work properly
|
267
|
-
out of the box: the value has to be url-encoded and decoded to survive transport.
|
268
|
-
|
269
|
-
Now, we generate Base64 urlsafe-encoded CSRF tokens, which are inherently safe
|
270
|
-
to transport. Validation accepts both urlsafe tokens, and strict-encoded tokens
|
271
|
-
for backwards compatibility.
|
272
|
-
|
273
|
-
*Scott Blum*
|
274
|
-
|
275
|
-
* Support rolling deploys for cookie serialization/encryption changes.
|
276
|
-
|
277
|
-
In a distributed configuration like rolling update, users may observe
|
278
|
-
both old and new instances during deployment. Users may be served by a
|
279
|
-
new instance and then by an old instance.
|
280
|
-
|
281
|
-
That means when the server changes `cookies_serializer` from `:marshal`
|
282
|
-
to `:hybrid` or the server changes `use_authenticated_cookie_encryption`
|
283
|
-
from `false` to `true`, users may lose their sessions if they access the
|
284
|
-
server during deployment.
|
88
|
+
* Add `cache_control: {}` option to `fresh_when` and `stale?`.
|
285
89
|
|
286
|
-
|
287
|
-
deployment, ensuring compatibility on both old and new instances.
|
90
|
+
Works as a shortcut to set `response.cache_control` with the above methods.
|
288
91
|
|
289
|
-
*
|
92
|
+
*Jacopo Beschi*
|
290
93
|
|
291
|
-
*
|
94
|
+
* Writing into a disabled session will now raise an error.
|
292
95
|
|
293
|
-
|
294
|
-
Now, the furthest proxy site is used. e.g.: It now gives an ip address when using curl from the load balancer.
|
96
|
+
Previously when no session store was set, writing into the session would silently fail.
|
295
97
|
|
296
|
-
*
|
98
|
+
*Jean Boussier*
|
297
99
|
|
298
|
-
*
|
100
|
+
* Add support for 'require-trusted-types-for' and 'trusted-types' headers.
|
299
101
|
|
300
|
-
|
301
|
-
gem dalli to be updated as well.
|
102
|
+
Fixes #42034.
|
302
103
|
|
303
|
-
|
104
|
+
*lfalcao*
|
304
105
|
|
305
|
-
*
|
106
|
+
* Remove inline styles and address basic accessibility issues on rescue templates.
|
306
107
|
|
307
|
-
|
308
|
-
meant it had its own copy of `@assertions`. This prevented the assertions
|
309
|
-
from being correctly counted and reported.
|
108
|
+
*Jacob Herrington*
|
310
109
|
|
311
|
-
|
312
|
-
root session.
|
313
|
-
|
314
|
-
Fixes #32142.
|
315
|
-
|
316
|
-
*Sam Bostock*
|
317
|
-
|
318
|
-
* Add SameSite protection to every written cookie.
|
319
|
-
|
320
|
-
Enabling `SameSite` cookie protection is an addition to CSRF protection,
|
321
|
-
where cookies won't be sent by browsers in cross-site POST requests when set to `:lax`.
|
322
|
-
|
323
|
-
`:strict` disables cookies being sent in cross-site GET or POST requests.
|
324
|
-
|
325
|
-
Passing `:none` disables this protection and is the same as previous versions albeit a `; SameSite=None` is appended to the cookie.
|
326
|
-
|
327
|
-
See upgrade instructions in config/initializers/new_framework_defaults_6_1.rb.
|
110
|
+
* Add support for 'private, no-store' Cache-Control headers.
|
328
111
|
|
329
|
-
|
112
|
+
Previously, 'no-store' was exclusive; no other directives could be specified.
|
330
113
|
|
331
|
-
|
114
|
+
*Alex Smith*
|
332
115
|
|
333
|
-
|
116
|
+
* Expand payload of `unpermitted_parameters.action_controller` instrumentation to allow subscribers to
|
117
|
+
know which controller action received unpermitted parameters.
|
334
118
|
|
335
|
-
*
|
119
|
+
*bbuchalter*
|
336
120
|
|
337
|
-
|
338
|
-
https://github.com/rails/routing_concerns was a better approach. Turned out
|
339
|
-
that this wasn't fully the case and loading external route files from the router
|
340
|
-
can be helpful for applications with a really large set of routes.
|
341
|
-
Without this feature, application needs to implement routes reloading
|
342
|
-
themselves and it's not straightforward.
|
121
|
+
* Add `ActionController::Live#send_stream` that makes it more convenient to send generated streams:
|
343
122
|
|
344
123
|
```ruby
|
345
|
-
|
346
|
-
|
347
|
-
Rails.application.routes.draw do
|
348
|
-
draw(:admin)
|
349
|
-
end
|
350
|
-
|
351
|
-
# config/routes/admin.rb
|
352
|
-
|
353
|
-
get :foo, to: 'foo#bar'
|
354
|
-
```
|
355
|
-
|
356
|
-
*Yehuda Katz*, *Edouard Chin*
|
357
|
-
|
358
|
-
* Fix system test driver option initialization for non-headless browsers.
|
359
|
-
|
360
|
-
*glaszig*
|
361
|
-
|
362
|
-
* `redirect_to.action_controller` notifications now include the `ActionDispatch::Request` in
|
363
|
-
their payloads as `:request`.
|
364
|
-
|
365
|
-
*Austin Story*
|
366
|
-
|
367
|
-
* `respond_to#any` no longer returns a response's Content-Type based on the
|
368
|
-
request format but based on the block given.
|
124
|
+
send_stream(filename: "subscribers.csv") do |stream|
|
125
|
+
stream.writeln "email_address,updated_at"
|
369
126
|
|
370
|
-
|
371
|
-
|
372
|
-
```ruby
|
373
|
-
def my_action
|
374
|
-
respond_to do |format|
|
375
|
-
format.any { render(json: { foo: 'bar' }) }
|
376
|
-
end
|
127
|
+
@subscribers.find_each do |subscriber|
|
128
|
+
stream.writeln [ subscriber.email_address, subscriber.updated_at ].join(",")
|
377
129
|
end
|
378
|
-
|
379
|
-
get('my_action.csv')
|
380
|
-
```
|
381
|
-
|
382
|
-
The previous behaviour was to respond with a `text/csv` Content-Type which
|
383
|
-
is inaccurate since a JSON response is being rendered.
|
384
|
-
|
385
|
-
Now it correctly returns a `application/json` Content-Type.
|
386
|
-
|
387
|
-
*Edouard Chin*
|
388
|
-
|
389
|
-
* Replaces (back)slashes in failure screenshot image paths with dashes.
|
390
|
-
|
391
|
-
If a failed test case contained a slash or a backslash, a screenshot would be created in a
|
392
|
-
nested directory, causing issues with `tmp:clear`.
|
393
|
-
|
394
|
-
*Damir Zekic*
|
395
|
-
|
396
|
-
* Add `params.member?` to mimic Hash behavior.
|
397
|
-
|
398
|
-
*Younes Serraj*
|
399
|
-
|
400
|
-
* `process_action.action_controller` notifications now include the following in their payloads:
|
401
|
-
|
402
|
-
* `:request` - the `ActionDispatch::Request`
|
403
|
-
* `:response` - the `ActionDispatch::Response`
|
404
|
-
|
405
|
-
*George Claghorn*
|
406
|
-
|
407
|
-
* Updated `ActionDispatch::Request.remote_ip` setter to clear set the instance
|
408
|
-
`remote_ip` to `nil` before setting the header that the value is derived
|
409
|
-
from.
|
410
|
-
|
411
|
-
Fixes #37383.
|
412
|
-
|
413
|
-
*Norm Provost*
|
414
|
-
|
415
|
-
* `ActionController::Base.log_at` allows setting a different log level per request.
|
416
|
-
|
417
|
-
```ruby
|
418
|
-
# Use the debug level if a particular cookie is set.
|
419
|
-
class ApplicationController < ActionController::Base
|
420
|
-
log_at :debug, if: -> { cookies[:debug] }
|
421
130
|
end
|
422
131
|
```
|
423
132
|
|
424
|
-
*
|
133
|
+
*DHH*
|
425
134
|
|
426
|
-
*
|
427
|
-
a test by prefixing the file name with an incrementing counter.
|
135
|
+
* Add `ActionController::Live::Buffer#writeln` to write a line to the stream with a newline included.
|
428
136
|
|
429
|
-
|
430
|
-
enable saving of HTML during a screenshot in addition to the image.
|
431
|
-
This uses the same image name, with the extension replaced with `.html`
|
137
|
+
*DHH*
|
432
138
|
|
433
|
-
|
139
|
+
* `ActionDispatch::Request#content_type` now returned Content-Type header as it is.
|
434
140
|
|
435
|
-
|
141
|
+
Previously, `ActionDispatch::Request#content_type` returned value does NOT contain charset part.
|
142
|
+
This behavior changed to returned Content-Type header containing charset part as it is.
|
436
143
|
|
437
|
-
|
438
|
-
header to determine what to return. And if we don't add `Vary`
|
439
|
-
in the response header, browsers might accidentally cache different
|
440
|
-
types of content, which would cause issues: e.g. javascript got displayed
|
441
|
-
instead of html content. This PR fixes these issues by adding `Vary: Accept`
|
442
|
-
in these types of requests. For more detailed problem description, please read:
|
144
|
+
If you want just MIME type, please use `ActionDispatch::Request#media_type` instead.
|
443
145
|
|
444
|
-
|
445
|
-
|
446
|
-
Fixes #25842.
|
447
|
-
|
448
|
-
*Stan Lo*
|
449
|
-
|
450
|
-
* Fix IntegrationTest `follow_redirect!` to follow redirection using the same HTTP verb when following
|
451
|
-
a 307 redirection.
|
452
|
-
|
453
|
-
*Edouard Chin*
|
454
|
-
|
455
|
-
* System tests require Capybara 3.26 or newer.
|
456
|
-
|
457
|
-
*George Claghorn*
|
458
|
-
|
459
|
-
* Reduced log noise handling ActionController::RoutingErrors.
|
460
|
-
|
461
|
-
*Alberto Fernández-Capel*
|
462
|
-
|
463
|
-
* Add DSL for configuring HTTP Feature Policy.
|
464
|
-
|
465
|
-
This new DSL provides a way to configure an HTTP Feature Policy at a
|
466
|
-
global or per-controller level. Full details of HTTP Feature Policy
|
467
|
-
specification and guidelines can be found at MDN:
|
468
|
-
|
469
|
-
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
|
470
|
-
|
471
|
-
Example global policy:
|
146
|
+
Before:
|
472
147
|
|
473
148
|
```ruby
|
474
|
-
|
475
|
-
|
476
|
-
f.gyroscope :none
|
477
|
-
f.microphone :none
|
478
|
-
f.usb :none
|
479
|
-
f.fullscreen :self
|
480
|
-
f.payment :self, "https://secure.example.com"
|
481
|
-
end
|
149
|
+
request = ActionDispatch::Request.new("CONTENT_TYPE" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
150
|
+
request.content_type #=> "text/csv"
|
482
151
|
```
|
483
152
|
|
484
|
-
|
153
|
+
After:
|
485
154
|
|
486
155
|
```ruby
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
end
|
491
|
-
end
|
156
|
+
request = ActionDispatch::Request.new("Content-Type" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
157
|
+
request.content_type #=> "text/csv; header=present; charset=utf-16"
|
158
|
+
request.media_type #=> "text/csv"
|
492
159
|
```
|
493
160
|
|
494
|
-
*
|
161
|
+
*Rafael Mendonça França*
|
495
162
|
|
496
|
-
*
|
163
|
+
* Change `ActionDispatch::Request#media_type` to return `nil` when the request don't have a `Content-Type` header.
|
497
164
|
|
498
|
-
|
165
|
+
*Rafael Mendonça França*
|
499
166
|
|
500
|
-
|
167
|
+
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
501
168
|
|
502
|
-
*
|
169
|
+
*Janko Marohnić*
|
503
170
|
|
504
|
-
|
505
|
-
take parameters the scope was lost when using path helpers. This commit
|
506
|
-
ensures scope is kept both when the route takes parameters or when it
|
507
|
-
doesn't.
|
171
|
+
* Allow anything with `#to_str` (like `Addressable::URI`) as a `redirect_to` location.
|
508
172
|
|
509
|
-
|
173
|
+
*ojab*
|
510
174
|
|
511
|
-
|
175
|
+
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
512
176
|
|
513
|
-
*
|
177
|
+
*Alex Robbin*
|
514
178
|
|
515
|
-
|
179
|
+
* Deprecate the ability to assign a single value to `config.action_dispatch.trusted_proxies`
|
180
|
+
as `RemoteIp` middleware behaves inconsistently depending on whether this is configured
|
181
|
+
with a single value or an enumerable.
|
516
182
|
|
517
|
-
|
518
|
-
an enumerator for the parameters instead of the underlying hash.
|
183
|
+
Fixes #40772.
|
519
184
|
|
520
|
-
*
|
185
|
+
*Christian Sutter*
|
521
186
|
|
522
|
-
*
|
523
|
-
|
187
|
+
* Add `redirect_back_or_to(fallback_location, **)` as a more aesthetically pleasing version of `redirect_back fallback_location:, **`.
|
188
|
+
The old method name is retained without explicit deprecation.
|
524
189
|
|
525
|
-
*
|
190
|
+
*DHH*
|
526
191
|
|
527
192
|
|
528
|
-
Please check [6-
|
193
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md) for previous changes.
|