actionpack 6.1.4.1 → 7.0.0.rc2
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 +191 -378
- 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 +21 -7
- 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 +3 -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 +4 -3
- 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/helpers.rb +1 -1
- data/lib/action_controller/metal/http_authentication.rb +17 -16
- data/lib/action_controller/metal/instrumentation.rb +57 -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 +20 -11
- data/lib/action_controller/metal/permissions_policy.rb +1 -1
- data/lib/action_controller/metal/redirecting.rb +86 -16
- data/lib/action_controller/metal/rendering.rb +7 -7
- data/lib/action_controller/metal/request_forgery_protection.rb +64 -24
- 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 +84 -47
- data/lib/action_controller/metal/testing.rb +0 -2
- data/lib/action_controller/metal.rb +7 -10
- data/lib/action_controller/railtie.rb +49 -6
- data/lib/action_controller/test_case.rb +19 -4
- data/lib/action_controller.rb +1 -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 +1 -13
- data/lib/action_dispatch/http/url.rb +11 -19
- 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 +6 -13
- 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 +8 -4
- 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/executor.rb +3 -0
- data/lib/action_dispatch/middleware/flash.rb +9 -11
- data/lib/action_dispatch/middleware/host_authorization.rb +44 -30
- data/lib/action_dispatch/middleware/remote_ip.rb +16 -4
- data/lib/action_dispatch/middleware/server_timing.rb +33 -0
- data/lib/action_dispatch/middleware/session/abstract_store.rb +1 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +17 -9
- data/lib/action_dispatch/middleware/stack.rb +27 -9
- data/lib/action_dispatch/middleware/static.rb +2 -6
- 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 +4 -3
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +3 -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/inspector.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +54 -78
- data/lib/action_dispatch/routing/redirection.rb +0 -2
- data/lib/action_dispatch/routing/route_set.rb +14 -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 +12 -6
- data/lib/action_dispatch/system_testing/browser.rb +2 -12
- data/lib/action_dispatch/system_testing/driver.rb +35 -11
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +10 -6
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -8
- 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 +3 -26
- data/lib/action_dispatch.rb +2 -1
- data/lib/action_pack/gem_version.rb +4 -4
- data/lib/action_pack.rb +1 -1
- metadata +18 -16
data/CHANGELOG.md
CHANGED
@@ -1,528 +1,341 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
2
2
|
|
3
|
-
* [CVE-2021-
|
3
|
+
* Fix X_FORWARDED_HOST protection. [CVE-2021-44528]
|
4
4
|
|
5
|
-
|
6
|
-
"allowed host" formats can cause the Host Authorization middleware in Action
|
7
|
-
Pack to redirect users to a malicious website.
|
5
|
+
* `Rails.application.executor` hooks can now be called around every request in a `ActionController::TestCase`
|
8
6
|
|
9
|
-
|
7
|
+
This helps to better simulate request or job local state being reset between requests and prevent state
|
8
|
+
leaking from one request to another.
|
10
9
|
|
11
|
-
|
10
|
+
To enable this, set `config.active_support.executor_around_test_case = true` (this is the default in Rails 7).
|
12
11
|
|
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*
|
12
|
+
*Alex Ghiculescu*
|
39
13
|
|
40
|
-
*
|
41
|
-
|
42
|
-
Previously, 'no-store' was exclusive; no other directives could be specified.
|
43
|
-
|
44
|
-
*Alex Smith*
|
45
|
-
|
46
|
-
|
47
|
-
## Rails 6.1.3.2 (May 05, 2021) ##
|
48
|
-
|
49
|
-
* Prevent open redirects by correctly escaping the host allow list
|
50
|
-
CVE-2021-22903
|
51
|
-
|
52
|
-
* Prevent catastrophic backtracking during mime parsing
|
53
|
-
CVE-2021-22902
|
14
|
+
* Consider onion services secure for cookies.
|
54
15
|
|
55
|
-
*
|
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
|
65
|
-
|
66
|
-
*Gannon McGibbon*
|
67
|
-
|
68
|
-
## Rails 6.1.3.1 (March 26, 2021) ##
|
69
|
-
|
70
|
-
* No changes.
|
16
|
+
*Justin Tracey*
|
71
17
|
|
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/
|
106
|
-
|
107
|
-
*Jan Klimo*
|
108
|
-
|
109
|
-
* Quietly handle unknown HTTP methods in Action Dispatch SSL middleware.
|
110
|
-
|
111
|
-
*Alex Robbin*
|
112
|
-
|
113
|
-
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
114
|
-
|
115
|
-
*Alex Robbin*
|
116
|
-
|
117
|
-
|
118
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
119
|
-
|
120
|
-
* Support for the HTTP header `Feature-Policy` has been revised to reflect
|
121
|
-
its [rename](https://github.com/w3c/webappsec-permissions-policy/pull/379) to [`Permissions-Policy`](https://w3c.github.io/webappsec-permissions-policy/#permissions-policy-http-header-field).
|
122
|
-
|
123
|
-
```ruby
|
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
|
-
```
|
133
|
-
|
134
|
-
*Julien Grillot*
|
135
|
-
|
136
|
-
* Allow `ActionDispatch::HostAuthorization` to exclude specific requests.
|
137
|
-
|
138
|
-
Host Authorization checks can be skipped for specific requests. This allows for health check requests to be permitted for requests with missing or non-matching host headers.
|
139
|
-
|
140
|
-
*Chris Bisnett*
|
141
|
-
|
142
|
-
* Add `config.action_dispatch.request_id_header` to allow changing the name of
|
143
|
-
the unique X-Request-Id header
|
144
|
-
|
145
|
-
*Arlston Fernandes*
|
146
|
-
|
147
|
-
* Deprecate `config.action_dispatch.return_only_media_type_on_content_type`.
|
18
|
+
* Remove deprecated `Rails.config.action_view.raise_on_missing_translations`.
|
148
19
|
|
149
20
|
*Rafael Mendonça França*
|
150
21
|
|
151
|
-
*
|
22
|
+
* Remove deprecated support to passing a path to `fixture_file_upload` relative to `fixture_path`.
|
152
23
|
|
153
24
|
*Rafael Mendonça França*
|
154
25
|
|
155
|
-
* Remove deprecated `ActionDispatch::
|
26
|
+
* Remove deprecated `ActionDispatch::SystemTestCase#host!`.
|
156
27
|
|
157
28
|
*Rafael Mendonça França*
|
158
29
|
|
159
|
-
*
|
160
|
-
|
161
|
-
If `no-store` is set on Cache-Control header it is exclusive (all other cache directives are dropped).
|
162
|
-
|
163
|
-
*Chris Kruger*
|
164
|
-
|
165
|
-
* Catch invalid UTF-8 parameters for POST requests and respond with BadRequest.
|
166
|
-
|
167
|
-
Additionally, perform `#set_binary_encoding` in `ActionDispatch::Http::Request#GET` and
|
168
|
-
`ActionDispatch::Http::Request#POST` prior to validating encoding.
|
169
|
-
|
170
|
-
*Adrianna Chang*
|
171
|
-
|
172
|
-
* Allow `assert_recognizes` routing assertions to work on mounted root routes.
|
173
|
-
|
174
|
-
*Gannon McGibbon*
|
30
|
+
* Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
|
175
31
|
|
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.
|
32
|
+
*Rafael Mendonça França*
|
182
33
|
|
183
|
-
|
34
|
+
* Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
|
184
35
|
|
185
|
-
*
|
186
|
-
chosen only if it is equal to or is a superdomain of the request host.
|
36
|
+
*Rafael Mendonça França*
|
187
37
|
|
188
|
-
|
38
|
+
* Raise `ActionController::Redirecting::UnsafeRedirectError` for unsafe `redirect_to` redirects.
|
189
39
|
|
190
|
-
|
40
|
+
This allows `rescue_from` to be used to add a default fallback route:
|
191
41
|
|
192
|
-
|
193
|
-
|
42
|
+
```ruby
|
43
|
+
rescue_from ActionController::Redirecting::UnsafeRedirectError do
|
44
|
+
redirect_to root_url
|
45
|
+
end
|
46
|
+
```
|
194
47
|
|
195
|
-
|
196
|
-
we check for public/some.js.br and serve that file, if present, with
|
197
|
-
`Content-Encoding: br` and `Vary: Accept-Encoding` headers.
|
48
|
+
*Kasper Timm Hansen*, *Chris Oliver*
|
198
49
|
|
199
|
-
|
50
|
+
* Add `url_from` to verify a redirect location is internal.
|
200
51
|
|
201
|
-
|
52
|
+
Takes the open redirect protection from `redirect_to` so users can wrap a
|
53
|
+
param, and fall back to an alternate redirect URL when the param provided
|
54
|
+
one is unsafe.
|
202
55
|
|
203
|
-
|
204
|
-
|
205
|
-
|
56
|
+
```ruby
|
57
|
+
def create
|
58
|
+
redirect_to url_from(params[:redirect_url]) || root_url
|
59
|
+
end
|
60
|
+
```
|
206
61
|
|
207
|
-
*
|
62
|
+
*dmcge*, *Kasper Timm Hansen*
|
208
63
|
|
209
|
-
*
|
64
|
+
* Allow Capybara driver name overrides in `SystemTestCase::driven_by`
|
210
65
|
|
211
|
-
|
66
|
+
Allow users to prevent conflicts among drivers that use the same driver
|
67
|
+
type (selenium, poltergeist, webkit, rack test).
|
212
68
|
|
213
|
-
|
214
|
-
without passing a block now returns an enumerator.
|
69
|
+
Fixes #42502
|
215
70
|
|
216
|
-
*
|
71
|
+
*Chris LaRose*
|
217
72
|
|
218
|
-
*
|
73
|
+
* Allow multiline to be passed in routes when using wildcard segments.
|
219
74
|
|
220
|
-
Previously
|
221
|
-
|
75
|
+
Previously routes with newlines weren't detected when using wildcard segments, returning
|
76
|
+
a `No route matches` error.
|
77
|
+
After this change, routes with newlines are detected on wildcard segments. Example
|
222
78
|
|
223
79
|
```ruby
|
224
|
-
|
225
|
-
|
80
|
+
draw do
|
81
|
+
get "/wildcard/*wildcard_segment", to: SimpleApp.new("foo#index"), as: :wildcard
|
82
|
+
end
|
226
83
|
|
227
|
-
|
228
|
-
|
84
|
+
# After the change, the path matches.
|
85
|
+
assert_equal "/wildcard/a%0Anewline", url_helpers.wildcard_path(wildcard_segment: "a\nnewline")
|
229
86
|
```
|
230
87
|
|
231
|
-
|
88
|
+
Fixes #39103
|
232
89
|
|
233
|
-
*
|
90
|
+
*Ignacio Chiazzo*
|
234
91
|
|
235
|
-
|
92
|
+
* Treat html suffix in controller translation.
|
236
93
|
|
237
|
-
*
|
238
|
-
strings/symbols with `String#constantize` instead of `require_dependency`.
|
94
|
+
*Rui Onodera*, *Gavin Miller*
|
239
95
|
|
240
|
-
|
241
|
-
always pass a module object:
|
96
|
+
* Allow permitting numeric params.
|
242
97
|
|
98
|
+
Previously it was impossible to permit different fields on numeric parameters.
|
99
|
+
After this change you can specify different fields for each numbered parameter.
|
100
|
+
For example params like,
|
243
101
|
```ruby
|
244
|
-
|
102
|
+
book: {
|
103
|
+
authors_attributes: {
|
104
|
+
'0': { name: "William Shakespeare", age_of_death: "52" },
|
105
|
+
'1': { name: "Unattributed Assistant" },
|
106
|
+
'2': "Not a hash",
|
107
|
+
'new_record': { name: "Some name" }
|
108
|
+
}
|
109
|
+
}
|
245
110
|
```
|
246
111
|
|
247
|
-
|
248
|
-
|
249
|
-
that same module object.
|
112
|
+
Before you could permit name on each author with,
|
113
|
+
`permit book: { authors_attributes: [ :name ] }`
|
250
114
|
|
251
|
-
|
115
|
+
After this change you can permit different keys on each numbered element,
|
116
|
+
`permit book: { authors_attributes: { '1': [ :name ], '0': [ :name, :age_of_death ] } }`
|
252
117
|
|
253
|
-
|
118
|
+
Fixes #41625
|
254
119
|
|
255
|
-
*
|
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.
|
120
|
+
*Adam Hess*
|
263
121
|
|
264
|
-
|
265
|
-
|
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.
|
122
|
+
* Update `HostAuthorization` middleware to render debug info only
|
123
|
+
when `config.consider_all_requests_local` is set to true.
|
268
124
|
|
269
|
-
|
270
|
-
to transport. Validation accepts both urlsafe tokens, and strict-encoded tokens
|
271
|
-
for backwards compatibility.
|
125
|
+
Also, blocked host info is always logged with level `error`.
|
272
126
|
|
273
|
-
|
127
|
+
Fixes #42813
|
274
128
|
|
275
|
-
*
|
129
|
+
*Nikita Vyrko*
|
276
130
|
|
277
|
-
|
278
|
-
both old and new instances during deployment. Users may be served by a
|
279
|
-
new instance and then by an old instance.
|
131
|
+
* Add Server-Timing middleware
|
280
132
|
|
281
|
-
|
282
|
-
|
283
|
-
from `false` to `true`, users may lose their sessions if they access the
|
284
|
-
server during deployment.
|
133
|
+
Server-Timing specification defines how the server can communicate to browsers performance metrics
|
134
|
+
about the request it is responding to.
|
285
135
|
|
286
|
-
|
287
|
-
|
136
|
+
The ServerTiming middleware is enabled by default on `development` environment by default using the
|
137
|
+
`config.server_timing` setting and set the relevant duration metrics in the `Server-Timing` header
|
288
138
|
|
289
|
-
|
139
|
+
The full specification for Server-Timing header can be found in: https://www.w3.org/TR/server-timing/#dfn-server-timing-header-field
|
290
140
|
|
291
|
-
*
|
141
|
+
*Sebastian Sogamoso*, *Guillermo Iguaran*
|
292
142
|
|
293
|
-
Before, if all `X-Forwarded-For` sites were trusted, the `remote_ip` would default to `127.0.0.1`.
|
294
|
-
Now, the furthest proxy site is used. e.g.: It now gives an ip address when using curl from the load balancer.
|
295
143
|
|
296
|
-
|
144
|
+
## Rails 7.0.0.alpha2 (September 15, 2021) ##
|
297
145
|
|
298
|
-
*
|
146
|
+
* No changes.
|
299
147
|
|
300
|
-
The `ActionDispatch::Session::MemcacheStore` is still vulnerable given it requires the
|
301
|
-
gem dalli to be updated as well.
|
302
148
|
|
303
|
-
|
149
|
+
## Rails 7.0.0.alpha1 (September 15, 2021) ##
|
304
150
|
|
305
|
-
*
|
151
|
+
* Use a static error message when raising `ActionDispatch::Http::Parameters::ParseError`
|
152
|
+
to avoid inadvertently logging the HTTP request body at the `fatal` level when it contains
|
153
|
+
malformed JSON.
|
306
154
|
|
307
|
-
|
308
|
-
meant it had its own copy of `@assertions`. This prevented the assertions
|
309
|
-
from being correctly counted and reported.
|
155
|
+
Fixes #41145
|
310
156
|
|
311
|
-
|
312
|
-
root session.
|
157
|
+
*Aaron Lahey*
|
313
158
|
|
314
|
-
|
159
|
+
* Add `Middleware#delete!` to delete middleware or raise if not found.
|
315
160
|
|
316
|
-
|
161
|
+
`Middleware#delete!` works just like `Middleware#delete` but will
|
162
|
+
raise an error if the middleware isn't found.
|
317
163
|
|
318
|
-
*
|
164
|
+
*Alex Ghiculescu*, *Petrik de Heus*, *Junichi Sato*
|
319
165
|
|
320
|
-
|
321
|
-
where cookies won't be sent by browsers in cross-site POST requests when set to `:lax`.
|
166
|
+
* Raise error on unpermitted open redirects.
|
322
167
|
|
323
|
-
|
168
|
+
Add `allow_other_host` options to `redirect_to`.
|
169
|
+
Opt in to this behaviour with `ActionController::Base.raise_on_open_redirects = true`.
|
324
170
|
|
325
|
-
|
171
|
+
*Gannon McGibbon*
|
326
172
|
|
327
|
-
|
173
|
+
* Deprecate `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1). Add `cuprite` instead.
|
328
174
|
|
329
|
-
|
175
|
+
[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.
|
330
176
|
|
331
|
-
|
177
|
+
[Cuprite](https://github.com/rubycdp/cuprite) is a good alternative to Poltergeist. Some guide descriptions are replaced from Poltergeist to Cuprite.
|
332
178
|
|
333
|
-
*
|
179
|
+
*Yusuke Iwaki*
|
334
180
|
|
335
|
-
*
|
181
|
+
* Exclude additional flash types from `ActionController::Base.action_methods`.
|
336
182
|
|
337
|
-
|
338
|
-
|
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.
|
183
|
+
Ensures that additional flash types defined on ActionController::Base subclasses
|
184
|
+
are not listed as actions on that controller.
|
343
185
|
|
344
|
-
|
345
|
-
|
186
|
+
class MyController < ApplicationController
|
187
|
+
add_flash_types :hype
|
188
|
+
end
|
346
189
|
|
347
|
-
|
348
|
-
draw(:admin)
|
349
|
-
end
|
190
|
+
MyController.action_methods.include?('hype') # => false
|
350
191
|
|
351
|
-
|
192
|
+
*Gavin Morrice*
|
352
193
|
|
353
|
-
|
354
|
-
```
|
194
|
+
* OpenSSL constants are now used for Digest computations.
|
355
195
|
|
356
|
-
*
|
196
|
+
*Dirkjan Bussink*
|
357
197
|
|
358
|
-
*
|
198
|
+
* Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module.
|
359
199
|
|
360
|
-
|
200
|
+
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.
|
361
201
|
|
362
|
-
*
|
363
|
-
their payloads as `:request`.
|
202
|
+
*Tadas Sasnauskas*
|
364
203
|
|
365
|
-
|
204
|
+
* Configuration setting to skip logging an uncaught exception backtrace when the exception is
|
205
|
+
present in `rescued_responses`.
|
366
206
|
|
367
|
-
|
368
|
-
|
207
|
+
It may be too noisy to get all backtraces logged for applications that manage uncaught
|
208
|
+
exceptions via `rescued_responses` and `exceptions_app`.
|
209
|
+
`config.action_dispatch.log_rescued_responses` (defaults to `true`) can be set to `false` in
|
210
|
+
this case, so that only exceptions not found in `rescued_responses` will be logged.
|
369
211
|
|
370
|
-
|
212
|
+
*Alexander Azarov*, *Mike Dalessio*
|
371
213
|
|
372
|
-
|
373
|
-
def my_action
|
374
|
-
respond_to do |format|
|
375
|
-
format.any { render(json: { foo: 'bar' }) }
|
376
|
-
end
|
377
|
-
end
|
214
|
+
* Ignore file fixtures on `db:fixtures:load`.
|
378
215
|
|
379
|
-
|
380
|
-
```
|
216
|
+
*Kevin Sjöberg*
|
381
217
|
|
382
|
-
|
383
|
-
is inaccurate since a JSON response is being rendered.
|
218
|
+
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
384
219
|
|
385
|
-
|
220
|
+
*Dylan Thacker-Smith*
|
386
221
|
|
387
|
-
|
222
|
+
* New `ActionController::ConditionalGet#no_store` method to set HTTP cache control `no-store` directive.
|
388
223
|
|
389
|
-
*
|
224
|
+
*Tadas Sasnauskas*
|
390
225
|
|
391
|
-
|
392
|
-
nested directory, causing issues with `tmp:clear`.
|
226
|
+
* Drop support for the `SERVER_ADDR` header.
|
393
227
|
|
394
|
-
|
228
|
+
Following up https://github.com/rack/rack/pull/1573 and https://github.com/rails/rails/pull/42349.
|
395
229
|
|
396
|
-
*
|
230
|
+
*Ricardo Díaz*
|
397
231
|
|
398
|
-
|
232
|
+
* Set session options when initializing a basic session.
|
399
233
|
|
400
|
-
*
|
234
|
+
*Gannon McGibbon*
|
401
235
|
|
402
|
-
|
403
|
-
* `:response` - the `ActionDispatch::Response`
|
236
|
+
* Add `cache_control: {}` option to `fresh_when` and `stale?`.
|
404
237
|
|
405
|
-
|
238
|
+
Works as a shortcut to set `response.cache_control` with the above methods.
|
406
239
|
|
407
|
-
*
|
408
|
-
`remote_ip` to `nil` before setting the header that the value is derived
|
409
|
-
from.
|
240
|
+
*Jacopo Beschi*
|
410
241
|
|
411
|
-
|
242
|
+
* Writing into a disabled session will now raise an error.
|
412
243
|
|
413
|
-
|
244
|
+
Previously when no session store was set, writing into the session would silently fail.
|
414
245
|
|
415
|
-
*
|
246
|
+
*Jean Boussier*
|
416
247
|
|
417
|
-
|
418
|
-
# Use the debug level if a particular cookie is set.
|
419
|
-
class ApplicationController < ActionController::Base
|
420
|
-
log_at :debug, if: -> { cookies[:debug] }
|
421
|
-
end
|
422
|
-
```
|
248
|
+
* Add support for 'require-trusted-types-for' and 'trusted-types' headers.
|
423
249
|
|
424
|
-
|
250
|
+
Fixes #42034.
|
425
251
|
|
426
|
-
*
|
427
|
-
a test by prefixing the file name with an incrementing counter.
|
252
|
+
*lfalcao*
|
428
253
|
|
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`
|
254
|
+
* Remove inline styles and address basic accessibility issues on rescue templates.
|
432
255
|
|
433
|
-
*
|
256
|
+
*Jacob Herrington*
|
434
257
|
|
435
|
-
* Add
|
258
|
+
* Add support for 'private, no-store' Cache-Control headers.
|
436
259
|
|
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:
|
260
|
+
Previously, 'no-store' was exclusive; no other directives could be specified.
|
443
261
|
|
444
|
-
|
262
|
+
*Alex Smith*
|
445
263
|
|
446
|
-
|
264
|
+
* Expand payload of `unpermitted_parameters.action_controller` instrumentation to allow subscribers to
|
265
|
+
know which controller action received unpermitted parameters.
|
447
266
|
|
448
|
-
*
|
267
|
+
*bbuchalter*
|
449
268
|
|
450
|
-
*
|
451
|
-
a 307 redirection.
|
269
|
+
* Add `ActionController::Live#send_stream` that makes it more convenient to send generated streams:
|
452
270
|
|
453
|
-
|
271
|
+
```ruby
|
272
|
+
send_stream(filename: "subscribers.csv") do |stream|
|
273
|
+
stream.writeln "email_address,updated_at"
|
454
274
|
|
455
|
-
|
275
|
+
@subscribers.find_each do |subscriber|
|
276
|
+
stream.writeln [ subscriber.email_address, subscriber.updated_at ].join(",")
|
277
|
+
end
|
278
|
+
end
|
279
|
+
```
|
456
280
|
|
457
|
-
*
|
281
|
+
*DHH*
|
458
282
|
|
459
|
-
*
|
283
|
+
* Add `ActionController::Live::Buffer#writeln` to write a line to the stream with a newline included.
|
460
284
|
|
461
|
-
*
|
285
|
+
*DHH*
|
462
286
|
|
463
|
-
*
|
287
|
+
* `ActionDispatch::Request#content_type` now returned Content-Type header as it is.
|
464
288
|
|
465
|
-
|
466
|
-
|
467
|
-
specification and guidelines can be found at MDN:
|
289
|
+
Previously, `ActionDispatch::Request#content_type` returned value does NOT contain charset part.
|
290
|
+
This behavior changed to returned Content-Type header containing charset part as it is.
|
468
291
|
|
469
|
-
|
292
|
+
If you want just MIME type, please use `ActionDispatch::Request#media_type` instead.
|
470
293
|
|
471
|
-
|
294
|
+
Before:
|
472
295
|
|
473
296
|
```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
|
297
|
+
request = ActionDispatch::Request.new("CONTENT_TYPE" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
298
|
+
request.content_type #=> "text/csv"
|
482
299
|
```
|
483
300
|
|
484
|
-
|
301
|
+
After:
|
485
302
|
|
486
303
|
```ruby
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
end
|
491
|
-
end
|
304
|
+
request = ActionDispatch::Request.new("Content-Type" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
305
|
+
request.content_type #=> "text/csv; header=present; charset=utf-16"
|
306
|
+
request.media_type #=> "text/csv"
|
492
307
|
```
|
493
308
|
|
494
|
-
*
|
309
|
+
*Rafael Mendonça França*
|
495
310
|
|
496
|
-
*
|
311
|
+
* Change `ActionDispatch::Request#media_type` to return `nil` when the request don't have a `Content-Type` header.
|
497
312
|
|
498
|
-
|
313
|
+
*Rafael Mendonça França*
|
499
314
|
|
500
|
-
|
315
|
+
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
501
316
|
|
502
|
-
*
|
317
|
+
*Janko Marohnić*
|
503
318
|
|
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.
|
319
|
+
* Allow anything with `#to_str` (like `Addressable::URI`) as a `redirect_to` location.
|
508
320
|
|
509
|
-
|
321
|
+
*ojab*
|
510
322
|
|
511
|
-
|
323
|
+
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
512
324
|
|
513
|
-
*
|
325
|
+
*Alex Robbin*
|
514
326
|
|
515
|
-
|
327
|
+
* Deprecate the ability to assign a single value to `config.action_dispatch.trusted_proxies`
|
328
|
+
as `RemoteIp` middleware behaves inconsistently depending on whether this is configured
|
329
|
+
with a single value or an enumerable.
|
516
330
|
|
517
|
-
|
518
|
-
an enumerator for the parameters instead of the underlying hash.
|
331
|
+
Fixes #40772.
|
519
332
|
|
520
|
-
*
|
333
|
+
*Christian Sutter*
|
521
334
|
|
522
|
-
*
|
523
|
-
|
335
|
+
* Add `redirect_back_or_to(fallback_location, **)` as a more aesthetically pleasing version of `redirect_back fallback_location:, **`.
|
336
|
+
The old method name is retained without explicit deprecation.
|
524
337
|
|
525
|
-
*
|
338
|
+
*DHH*
|
526
339
|
|
527
340
|
|
528
|
-
Please check [6-
|
341
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md) for previous changes.
|