actionpack 6.0.3.7 → 6.1.3.2
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 +287 -226
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/abstract_controller.rb +1 -0
- data/lib/abstract_controller/base.rb +35 -2
- data/lib/abstract_controller/callbacks.rb +2 -2
- data/lib/abstract_controller/helpers.rb +105 -90
- data/lib/abstract_controller/railties/routes_helpers.rb +17 -1
- data/lib/abstract_controller/rendering.rb +9 -9
- data/lib/abstract_controller/translation.rb +8 -2
- data/lib/action_controller.rb +2 -3
- data/lib/action_controller/api.rb +2 -2
- data/lib/action_controller/base.rb +4 -2
- data/lib/action_controller/caching.rb +0 -1
- data/lib/action_controller/log_subscriber.rb +3 -3
- data/lib/action_controller/metal.rb +2 -2
- data/lib/action_controller/metal/conditional_get.rb +11 -3
- data/lib/action_controller/metal/content_security_policy.rb +1 -1
- data/lib/action_controller/metal/cookies.rb +3 -1
- data/lib/action_controller/metal/data_streaming.rb +1 -1
- data/lib/action_controller/metal/etag_with_template_digest.rb +2 -4
- data/lib/action_controller/metal/exceptions.rb +33 -0
- data/lib/action_controller/metal/head.rb +7 -4
- data/lib/action_controller/metal/helpers.rb +11 -1
- data/lib/action_controller/metal/http_authentication.rb +4 -2
- data/lib/action_controller/metal/implicit_render.rb +1 -1
- data/lib/action_controller/metal/instrumentation.rb +11 -9
- data/lib/action_controller/metal/live.rb +1 -1
- data/lib/action_controller/metal/logging.rb +20 -0
- data/lib/action_controller/metal/mime_responds.rb +6 -2
- data/lib/action_controller/metal/parameter_encoding.rb +35 -4
- data/lib/action_controller/metal/params_wrapper.rb +14 -8
- data/lib/action_controller/metal/permissions_policy.rb +46 -0
- data/lib/action_controller/metal/redirecting.rb +1 -1
- data/lib/action_controller/metal/rendering.rb +6 -0
- data/lib/action_controller/metal/request_forgery_protection.rb +48 -24
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/strong_parameters.rb +103 -15
- data/lib/action_controller/renderer.rb +24 -13
- data/lib/action_controller/test_case.rb +62 -56
- data/lib/action_dispatch.rb +3 -2
- data/lib/action_dispatch/http/cache.rb +12 -10
- data/lib/action_dispatch/http/content_disposition.rb +2 -2
- data/lib/action_dispatch/http/content_security_policy.rb +5 -1
- data/lib/action_dispatch/http/filter_parameters.rb +1 -1
- data/lib/action_dispatch/http/filter_redirect.rb +1 -1
- data/lib/action_dispatch/http/headers.rb +3 -2
- data/lib/action_dispatch/http/mime_negotiation.rb +20 -8
- data/lib/action_dispatch/http/mime_type.rb +29 -16
- data/lib/action_dispatch/http/parameters.rb +1 -19
- data/lib/action_dispatch/http/permissions_policy.rb +173 -0
- data/lib/action_dispatch/http/request.rb +26 -8
- data/lib/action_dispatch/http/response.rb +17 -16
- data/lib/action_dispatch/http/url.rb +3 -2
- data/lib/action_dispatch/journey.rb +0 -2
- data/lib/action_dispatch/journey/formatter.rb +53 -28
- data/lib/action_dispatch/journey/gtg/builder.rb +22 -36
- data/lib/action_dispatch/journey/gtg/simulator.rb +8 -7
- data/lib/action_dispatch/journey/gtg/transition_table.rb +6 -4
- data/lib/action_dispatch/journey/nfa/dot.rb +0 -11
- data/lib/action_dispatch/journey/nodes/node.rb +4 -3
- data/lib/action_dispatch/journey/parser.rb +13 -13
- data/lib/action_dispatch/journey/parser.y +1 -1
- data/lib/action_dispatch/journey/path/pattern.rb +13 -18
- data/lib/action_dispatch/journey/route.rb +7 -18
- data/lib/action_dispatch/journey/router.rb +26 -30
- data/lib/action_dispatch/journey/router/utils.rb +6 -4
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +2 -2
- data/lib/action_dispatch/middleware/cookies.rb +74 -33
- data/lib/action_dispatch/middleware/debug_exceptions.rb +10 -17
- data/lib/action_dispatch/middleware/debug_view.rb +1 -1
- data/lib/action_dispatch/middleware/exception_wrapper.rb +29 -17
- data/lib/action_dispatch/middleware/host_authorization.rb +27 -7
- data/lib/action_dispatch/middleware/public_exceptions.rb +1 -1
- data/lib/action_dispatch/middleware/remote_ip.rb +5 -4
- data/lib/action_dispatch/middleware/request_id.rb +4 -5
- data/lib/action_dispatch/middleware/session/abstract_store.rb +2 -2
- data/lib/action_dispatch/middleware/session/cookie_store.rb +2 -2
- data/lib/action_dispatch/middleware/show_exceptions.rb +2 -0
- data/lib/action_dispatch/middleware/ssl.rb +12 -7
- data/lib/action_dispatch/middleware/stack.rb +19 -1
- data/lib/action_dispatch/middleware/static.rb +154 -93
- data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +22 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +2 -5
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +100 -8
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +21 -1
- data/lib/action_dispatch/railtie.rb +3 -2
- data/lib/action_dispatch/request/session.rb +2 -8
- data/lib/action_dispatch/request/utils.rb +26 -2
- data/lib/action_dispatch/routing/inspector.rb +8 -7
- data/lib/action_dispatch/routing/mapper.rb +102 -71
- data/lib/action_dispatch/routing/polymorphic_routes.rb +12 -11
- data/lib/action_dispatch/routing/redirection.rb +4 -4
- data/lib/action_dispatch/routing/route_set.rb +49 -41
- data/lib/action_dispatch/routing/url_for.rb +1 -0
- data/lib/action_dispatch/system_test_case.rb +29 -24
- data/lib/action_dispatch/system_testing/browser.rb +33 -27
- data/lib/action_dispatch/system_testing/driver.rb +6 -7
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +47 -6
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +4 -7
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/assertions/response.rb +2 -4
- data/lib/action_dispatch/testing/assertions/routing.rb +5 -5
- data/lib/action_dispatch/testing/integration.rb +40 -29
- data/lib/action_dispatch/testing/test_process.rb +29 -4
- data/lib/action_dispatch/testing/test_request.rb +3 -3
- data/lib/action_pack.rb +1 -1
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +16 -17
- data/lib/action_controller/metal/force_ssl.rb +0 -58
- data/lib/action_dispatch/http/parameter_filter.rb +0 -12
- data/lib/action_dispatch/journey/nfa/builder.rb +0 -78
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -47
- data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -119
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cfba18fd1e2c6507de318e22c9cab8f878c22b9cbce70065f9c2ff9053f1d96
|
4
|
+
data.tar.gz: 178c4347f79392aaa6d452c3eeb406cbecf66a9b3ece0d244f98d7a4fa15b6ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6479340989a0677d3e64e0723a67c0cc64ea4dc9d5fcfe6bfad6538703582f3b95bc2426b68c56c2dda3a1b66842e7ed890b70fefbf136c8a198d23336525447
|
7
|
+
data.tar.gz: 9021e02a953bf859d984e3722561745d0b562292b3fe3566ee1d362a9eb8c06af868f2d17db7dd5558e31871f626a39d8d9a7bb9b34697c5d26b8b58a533db4f
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
## Rails 6.
|
1
|
+
## Rails 6.1.3.2 (May 05, 2021) ##
|
2
|
+
|
3
|
+
* Prevent open redirects by correctly escaping the host allow list
|
4
|
+
CVE-2021-22903
|
2
5
|
|
3
6
|
* Prevent catastrophic backtracking during mime parsing
|
4
7
|
CVE-2021-22902
|
@@ -16,12 +19,19 @@
|
|
16
19
|
|
17
20
|
*Gannon McGibbon*
|
18
21
|
|
19
|
-
## Rails 6.
|
22
|
+
## Rails 6.1.3.1 (March 26, 2021) ##
|
20
23
|
|
21
24
|
* No changes.
|
22
25
|
|
23
26
|
|
24
|
-
## Rails 6.
|
27
|
+
## Rails 6.1.3 (February 17, 2021) ##
|
28
|
+
|
29
|
+
* Re-define routes when not set correctly via inheritance.
|
30
|
+
|
31
|
+
*John Hawthorn*
|
32
|
+
|
33
|
+
|
34
|
+
## Rails 6.1.2.1 (February 10, 2021) ##
|
25
35
|
|
26
36
|
* Prevent open redirect when allowed host starts with a dot
|
27
37
|
|
@@ -33,389 +43,440 @@
|
|
33
43
|
*Aaron Patterson*
|
34
44
|
|
35
45
|
|
36
|
-
## Rails 6.
|
37
|
-
|
38
|
-
* [CVE-2020-8264] Prevent XSS in Actionable Exceptions
|
46
|
+
## Rails 6.1.2 (February 09, 2021) ##
|
39
47
|
|
48
|
+
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
40
49
|
|
41
|
-
|
50
|
+
*Janko Marohnić*
|
42
51
|
|
43
|
-
*
|
52
|
+
* Fix `fixture_file_upload` deprecation when `file_fixture_path` is a relative path.
|
44
53
|
|
54
|
+
*Eugene Kenny*
|
45
55
|
|
46
|
-
## Rails 6.0.3.2 (June 17, 2020) ##
|
47
56
|
|
48
|
-
|
57
|
+
## Rails 6.1.1 (January 07, 2021) ##
|
49
58
|
|
50
|
-
|
59
|
+
* Fix nil translation key lookup in controllers/
|
51
60
|
|
52
|
-
*
|
61
|
+
*Jan Klimo*
|
53
62
|
|
54
|
-
*
|
63
|
+
* Quietly handle unknown HTTP methods in Action Dispatch SSL middleware.
|
55
64
|
|
56
|
-
|
65
|
+
*Alex Robbin*
|
57
66
|
|
58
|
-
*
|
67
|
+
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
59
68
|
|
60
|
-
|
61
|
-
meant it had its own copy of `@assertions`. This prevented the assertions
|
62
|
-
from being correctly counted and reported.
|
69
|
+
*Alex Robbin*
|
63
70
|
|
64
|
-
Child sessions now have their `attr_accessor` overriden to delegate to the
|
65
|
-
root session.
|
66
71
|
|
67
|
-
|
72
|
+
## Rails 6.1.0 (December 09, 2020) ##
|
68
73
|
|
69
|
-
|
74
|
+
* Support for the HTTP header `Feature-Policy` has been revised to reflect
|
75
|
+
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).
|
70
76
|
|
77
|
+
```ruby
|
78
|
+
Rails.application.config.permissions_policy do |p|
|
79
|
+
p.camera :none
|
80
|
+
p.gyroscope :none
|
81
|
+
p.microphone :none
|
82
|
+
p.usb :none
|
83
|
+
p.fullscreen :self
|
84
|
+
p.payment :self, "https://secure-example.com"
|
85
|
+
end
|
86
|
+
```
|
71
87
|
|
72
|
-
|
88
|
+
*Julien Grillot*
|
73
89
|
|
74
|
-
*
|
90
|
+
* Allow `ActionDispatch::HostAuthorization` to exclude specific requests.
|
75
91
|
|
92
|
+
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.
|
76
93
|
|
77
|
-
|
94
|
+
*Chris Bisnett*
|
78
95
|
|
79
|
-
*
|
96
|
+
* Add `config.action_dispatch.request_id_header` to allow changing the name of
|
97
|
+
the unique X-Request-Id header
|
80
98
|
|
81
|
-
|
82
|
-
gem dalli to be updated as well.
|
99
|
+
*Arlston Fernandes*
|
83
100
|
|
84
|
-
|
101
|
+
* Deprecate `config.action_dispatch.return_only_media_type_on_content_type`.
|
85
102
|
|
103
|
+
*Rafael Mendonça França*
|
86
104
|
|
87
|
-
|
105
|
+
* Change `ActionDispatch::Response#content_type` to return the full Content-Type header.
|
88
106
|
|
89
|
-
*
|
107
|
+
*Rafael Mendonça França*
|
90
108
|
|
91
|
-
|
109
|
+
* Remove deprecated `ActionDispatch::Http::ParameterFilter`.
|
92
110
|
|
111
|
+
*Rafael Mendonça França*
|
93
112
|
|
94
|
-
|
113
|
+
* Added support for exclusive no-store Cache-Control header.
|
95
114
|
|
96
|
-
|
97
|
-
rather than `ActionDispatch::IntegrationTest`. This permits running jobs in
|
98
|
-
system tests.
|
115
|
+
If `no-store` is set on Cache-Control header it is exclusive (all other cache directives are dropped).
|
99
116
|
|
100
|
-
*
|
117
|
+
*Chris Kruger*
|
101
118
|
|
102
|
-
*
|
119
|
+
* Catch invalid UTF-8 parameters for POST requests and respond with BadRequest.
|
103
120
|
|
104
|
-
|
105
|
-
|
106
|
-
```
|
121
|
+
Additionally, perform `#set_binary_encoding` in `ActionDispatch::Http::Request#GET` and
|
122
|
+
`ActionDispatch::Http::Request#POST` prior to validating encoding.
|
107
123
|
|
108
|
-
*
|
124
|
+
*Adrianna Chang*
|
109
125
|
|
126
|
+
* Allow `assert_recognizes` routing assertions to work on mounted root routes.
|
110
127
|
|
111
|
-
|
128
|
+
*Gannon McGibbon*
|
112
129
|
|
113
|
-
*
|
130
|
+
* Change default redirection status code for non-GET/HEAD requests to 308 Permanent Redirect for `ActionDispatch::SSL`.
|
114
131
|
|
132
|
+
*Alan Tan*, *Oz Ben-David*
|
115
133
|
|
116
|
-
|
134
|
+
* Fix `follow_redirect!` to follow redirection with same HTTP verb when following
|
135
|
+
a 308 redirection.
|
117
136
|
|
118
|
-
*
|
137
|
+
*Alan Tan*
|
119
138
|
|
120
|
-
|
139
|
+
* When multiple domains are specified for a cookie, a domain will now be
|
140
|
+
chosen only if it is equal to or is a superdomain of the request host.
|
121
141
|
|
122
|
-
*
|
142
|
+
*Jonathan Hefner*
|
123
143
|
|
124
|
-
*
|
144
|
+
* `ActionDispatch::Static` handles precompiled Brotli (.br) files.
|
125
145
|
|
126
|
-
|
127
|
-
|
128
|
-
ensures scope is kept both when the route takes parameters or when it
|
129
|
-
doesn't.
|
146
|
+
Adds to existing support for precompiled gzip (.gz) files.
|
147
|
+
Brotli files are preferred due to much better compression.
|
130
148
|
|
131
|
-
|
149
|
+
When the browser requests /some.js with `Accept-Encoding: br`,
|
150
|
+
we check for public/some.js.br and serve that file, if present, with
|
151
|
+
`Content-Encoding: br` and `Vary: Accept-Encoding` headers.
|
132
152
|
|
133
|
-
*
|
153
|
+
*Ryan Edward Hall*, *Jeremy Daer*
|
134
154
|
|
135
|
-
*
|
155
|
+
* Add raise_on_missing_translations support for controllers.
|
136
156
|
|
137
|
-
|
138
|
-
|
139
|
-
|
157
|
+
This configuration determines whether an error should be raised for missing translations.
|
158
|
+
It can be enabled through `config.i18n.raise_on_missing_translations`. Note that described
|
159
|
+
configuration also affects raising error for missing translations in views.
|
140
160
|
|
141
|
-
|
142
|
-
instead.
|
161
|
+
*fatkodima*
|
143
162
|
|
144
|
-
|
145
|
-
If not enabled, `ActionDispatch::Response#content_type` returns the same
|
146
|
-
value as before version, but its behavior is deprecate.
|
163
|
+
* Added `compact` and `compact!` to `ActionController::Parameters`.
|
147
164
|
|
148
|
-
*
|
165
|
+
*Eugene Kenny*
|
149
166
|
|
150
|
-
* Calling `
|
151
|
-
|
167
|
+
* Calling `each_pair` or `each_value` on an `ActionController::Parameters`
|
168
|
+
without passing a block now returns an enumerator.
|
152
169
|
|
153
170
|
*Eugene Kenny*
|
154
171
|
|
155
|
-
*
|
172
|
+
* `fixture_file_upload` now uses path relative to `file_fixture_path`
|
156
173
|
|
157
|
-
|
174
|
+
Previously the path had to be relative to `fixture_path`.
|
175
|
+
You can change your existing code as follow:
|
158
176
|
|
177
|
+
```ruby
|
178
|
+
# Before
|
179
|
+
fixture_file_upload('files/dog.png')
|
159
180
|
|
160
|
-
|
181
|
+
# After
|
182
|
+
fixture_file_upload('dog.png')
|
183
|
+
```
|
161
184
|
|
162
|
-
*
|
163
|
-
rather than an `after_teardown` hook.
|
185
|
+
*Edouard Chin*
|
164
186
|
|
165
|
-
|
166
|
-
the screenshot is taken (reducing the time in which the page could have
|
167
|
-
been dynamically updated after the assertion failed).
|
187
|
+
* Remove deprecated `force_ssl` at the controller level.
|
168
188
|
|
169
|
-
*
|
189
|
+
*Rafael Mendonça França*
|
170
190
|
|
171
|
-
*
|
191
|
+
* The +helper+ class method for controllers loads helper modules specified as
|
192
|
+
strings/symbols with `String#constantize` instead of `require_dependency`.
|
172
193
|
|
173
|
-
|
174
|
-
|
194
|
+
Remember that support for strings/symbols is only a convenient API. You can
|
195
|
+
always pass a module object:
|
175
196
|
|
176
|
-
|
197
|
+
```ruby
|
198
|
+
helper UtilsHelper
|
199
|
+
```
|
177
200
|
|
178
|
-
|
201
|
+
which is recommended because it is simple and direct. When a string/symbol
|
202
|
+
is received, `helper` just manipulates and inflects the argument to obtain
|
203
|
+
that same module object.
|
179
204
|
|
180
|
-
*
|
205
|
+
*Xavier Noria*, *Jean Boussier*
|
181
206
|
|
182
|
-
|
207
|
+
* Correctly identify the entire localhost IPv4 range as trusted proxy.
|
183
208
|
|
184
|
-
|
185
|
-
routes.draw do
|
186
|
-
resources :users, param: 'name/:sneaky'
|
187
|
-
end
|
188
|
-
```
|
209
|
+
*Nick Soracco*
|
189
210
|
|
190
|
-
|
211
|
+
* `url_for` will now use "https://" as the default protocol when
|
212
|
+
`Rails.application.config.force_ssl` is set to true.
|
191
213
|
|
192
|
-
*
|
214
|
+
*Jonathan Hefner*
|
193
215
|
|
216
|
+
* Accept and default to base64_urlsafe CSRF tokens.
|
194
217
|
|
195
|
-
|
218
|
+
Base64 strict-encoded CSRF tokens are not inherently websafe, which makes
|
219
|
+
them difficult to deal with. For example, the common practice of sending
|
220
|
+
the CSRF token to a browser in a client-readable cookie does not work properly
|
221
|
+
out of the box: the value has to be url-encoded and decoded to survive transport.
|
196
222
|
|
197
|
-
|
223
|
+
Now, we generate Base64 urlsafe-encoded CSRF tokens, which are inherently safe
|
224
|
+
to transport. Validation accepts both urlsafe tokens, and strict-encoded tokens
|
225
|
+
for backwards compatibility.
|
198
226
|
|
227
|
+
*Scott Blum*
|
199
228
|
|
200
|
-
|
229
|
+
* Support rolling deploys for cookie serialization/encryption changes.
|
201
230
|
|
202
|
-
|
231
|
+
In a distributed configuration like rolling update, users may observe
|
232
|
+
both old and new instances during deployment. Users may be served by a
|
233
|
+
new instance and then by an old instance.
|
203
234
|
|
204
|
-
|
235
|
+
That means when the server changes `cookies_serializer` from `:marshal`
|
236
|
+
to `:hybrid` or the server changes `use_authenticated_cookie_encryption`
|
237
|
+
from `false` to `true`, users may lose their sessions if they access the
|
238
|
+
server during deployment.
|
205
239
|
|
206
|
-
|
207
|
-
|
240
|
+
We added fallbacks to downgrade the cookie format when necessary during
|
241
|
+
deployment, ensuring compatibility on both old and new instances.
|
208
242
|
|
209
|
-
*
|
243
|
+
*Masaki Hara*
|
210
244
|
|
245
|
+
* `ActionDispatch::Request.remote_ip` has ip address even when all sites are trusted.
|
211
246
|
|
212
|
-
|
247
|
+
Before, if all `X-Forwarded-For` sites were trusted, the `remote_ip` would default to `127.0.0.1`.
|
248
|
+
Now, the furthest proxy site is used. e.g.: It now gives an ip address when using curl from the load balancer.
|
213
249
|
|
214
|
-
*
|
250
|
+
*Keenan Brock*
|
215
251
|
|
216
|
-
|
252
|
+
* Fix possible information leak / session hijacking vulnerability.
|
217
253
|
|
218
|
-
|
254
|
+
The `ActionDispatch::Session::MemcacheStore` is still vulnerable given it requires the
|
255
|
+
gem dalli to be updated as well.
|
219
256
|
|
220
|
-
|
221
|
-
`#successful?`, `not_found?` and `server_error?`.
|
257
|
+
CVE-2019-16782.
|
222
258
|
|
223
|
-
|
259
|
+
* Include child session assertion count in ActionDispatch::IntegrationTest.
|
224
260
|
|
225
|
-
|
261
|
+
`IntegrationTest#open_session` uses `dup` to create the new session, which
|
262
|
+
meant it had its own copy of `@assertions`. This prevented the assertions
|
263
|
+
from being correctly counted and reported.
|
226
264
|
|
227
|
-
|
228
|
-
|
265
|
+
Child sessions now have their `attr_accessor` overridden to delegate to the
|
266
|
+
root session.
|
229
267
|
|
230
|
-
|
231
|
-
`Proc`, `IPAddr` and custom objects as host allowances.
|
268
|
+
Fixes #32142.
|
232
269
|
|
233
|
-
*
|
270
|
+
*Sam Bostock*
|
234
271
|
|
235
|
-
*
|
272
|
+
* Add SameSite protection to every written cookie.
|
236
273
|
|
237
|
-
|
238
|
-
|
274
|
+
Enabling `SameSite` cookie protection is an addition to CSRF protection,
|
275
|
+
where cookies won't be sent by browsers in cross-site POST requests when set to `:lax`.
|
239
276
|
|
240
|
-
|
241
|
-
class SomeControllerTest < ActionController::TestCase
|
242
|
-
def test_some_action
|
243
|
-
post :action, body: { foo: 'bar' }
|
244
|
-
assert_equal({ "foo" => "bar" }, response.parsed_body)
|
245
|
-
end
|
246
|
-
end
|
247
|
-
```
|
277
|
+
`:strict` disables cookies being sent in cross-site GET or POST requests.
|
248
278
|
|
249
|
-
|
279
|
+
Passing `:none` disables this protection and is the same as previous versions albeit a `; SameSite=None` is appended to the cookie.
|
250
280
|
|
251
|
-
|
281
|
+
See upgrade instructions in config/initializers/new_framework_defaults_6_1.rb.
|
252
282
|
|
253
|
-
|
283
|
+
More info [here](https://tools.ietf.org/html/draft-west-first-party-cookies-07)
|
254
284
|
|
255
|
-
|
256
|
-
same context instead of assigning nil names to subsequent roots.
|
285
|
+
_NB: Technically already possible as Rack supports SameSite protection, this is to ensure it's applied to all cookies_
|
257
286
|
|
258
|
-
*
|
287
|
+
*Cédric Fabianski*
|
259
288
|
|
260
|
-
*
|
289
|
+
* Bring back the feature that allows loading external route files from the router.
|
261
290
|
|
262
|
-
|
263
|
-
|
264
|
-
|
291
|
+
This feature existed back in 2012 but got reverted with the incentive that
|
292
|
+
https://github.com/rails/routing_concerns was a better approach. Turned out
|
293
|
+
that this wasn't fully the case and loading external route files from the router
|
294
|
+
can be helpful for applications with a really large set of routes.
|
295
|
+
Without this feature, application needs to implement routes reloading
|
296
|
+
themselves and it's not straightforward.
|
297
|
+
|
298
|
+
```ruby
|
299
|
+
# config/routes.rb
|
300
|
+
|
301
|
+
Rails.application.routes.draw do
|
302
|
+
draw(:admin)
|
265
303
|
end
|
304
|
+
|
305
|
+
# config/routes/admin.rb
|
306
|
+
|
307
|
+
get :foo, to: 'foo#bar'
|
266
308
|
```
|
267
309
|
|
268
|
-
*
|
310
|
+
*Yehuda Katz*, *Edouard Chin*
|
311
|
+
|
312
|
+
* Fix system test driver option initialization for non-headless browsers.
|
313
|
+
|
314
|
+
*glaszig*
|
269
315
|
|
270
|
-
*
|
316
|
+
* `redirect_to.action_controller` notifications now include the `ActionDispatch::Request` in
|
317
|
+
their payloads as `:request`.
|
271
318
|
|
272
|
-
|
273
|
-
in system test `after_teardown`.
|
319
|
+
*Austin Story*
|
274
320
|
|
275
|
-
|
321
|
+
* `respond_to#any` no longer returns a response's Content-Type based on the
|
322
|
+
request format but based on the block given.
|
276
323
|
|
277
|
-
|
324
|
+
Example:
|
278
325
|
|
279
|
-
|
280
|
-
|
281
|
-
|
326
|
+
```ruby
|
327
|
+
def my_action
|
328
|
+
respond_to do |format|
|
329
|
+
format.any { render(json: { foo: 'bar' }) }
|
330
|
+
end
|
331
|
+
end
|
282
332
|
|
283
|
-
|
333
|
+
get('my_action.csv')
|
334
|
+
```
|
284
335
|
|
285
|
-
|
336
|
+
The previous behaviour was to respond with a `text/csv` Content-Type which
|
337
|
+
is inaccurate since a JSON response is being rendered.
|
286
338
|
|
287
|
-
|
339
|
+
Now it correctly returns a `application/json` Content-Type.
|
288
340
|
|
289
|
-
|
290
|
-
would be converted to a string implicitly, e.g:
|
341
|
+
*Edouard Chin*
|
291
342
|
|
292
|
-
|
343
|
+
* Replaces (back)slashes in failure screenshot image paths with dashes.
|
293
344
|
|
294
|
-
would
|
345
|
+
If a failed test case contained a slash or a backslash, a screenshot would be created in a
|
346
|
+
nested directory, causing issues with `tmp:clear`.
|
295
347
|
|
296
|
-
|
348
|
+
*Damir Zekic*
|
297
349
|
|
298
|
-
|
350
|
+
* Add `params.member?` to mimic Hash behavior.
|
299
351
|
|
300
|
-
|
352
|
+
*Younes Serraj*
|
301
353
|
|
302
|
-
|
354
|
+
* `process_action.action_controller` notifications now include the following in their payloads:
|
303
355
|
|
304
|
-
*
|
356
|
+
* `:request` - the `ActionDispatch::Request`
|
357
|
+
* `:response` - the `ActionDispatch::Response`
|
305
358
|
|
306
|
-
*
|
359
|
+
*George Claghorn*
|
307
360
|
|
308
|
-
*
|
361
|
+
* Updated `ActionDispatch::Request.remote_ip` setter to clear set the instance
|
362
|
+
`remote_ip` to `nil` before setting the header that the value is derived
|
363
|
+
from.
|
309
364
|
|
310
|
-
|
365
|
+
Fixes #37383.
|
311
366
|
|
312
|
-
*
|
313
|
-
Previously, `send_data 'data', filename: "\u{3042}.txt"` sends
|
314
|
-
`"filename=\"\u{3042}.txt\""` as Content-Disposition and it can be
|
315
|
-
garbled.
|
316
|
-
Now it follows [RFC 2231](https://tools.ietf.org/html/rfc2231) and
|
317
|
-
[RFC 5987](https://tools.ietf.org/html/rfc5987) and sends
|
318
|
-
`"filename=\"%3F.txt\"; filename*=UTF-8''%E3%81%82.txt"`.
|
319
|
-
Most browsers can find filename correctly and old browsers fallback to ASCII
|
320
|
-
converted name.
|
367
|
+
*Norm Provost*
|
321
368
|
|
322
|
-
|
369
|
+
* `ActionController::Base.log_at` allows setting a different log level per request.
|
323
370
|
|
324
|
-
|
325
|
-
|
371
|
+
```ruby
|
372
|
+
# Use the debug level if a particular cookie is set.
|
373
|
+
class ApplicationController < ActionController::Base
|
374
|
+
log_at :debug, if: -> { cookies[:debug] }
|
375
|
+
end
|
376
|
+
```
|
326
377
|
|
327
|
-
*
|
378
|
+
*George Claghorn*
|
328
379
|
|
329
|
-
*
|
380
|
+
* Allow system test screen shots to be taken more than once in
|
381
|
+
a test by prefixing the file name with an incrementing counter.
|
330
382
|
|
331
|
-
|
332
|
-
|
383
|
+
Add an environment variable `RAILS_SYSTEM_TESTING_SCREENSHOT_HTML` to
|
384
|
+
enable saving of HTML during a screenshot in addition to the image.
|
385
|
+
This uses the same image name, with the extension replaced with `.html`
|
333
386
|
|
334
|
-
|
335
|
-
then signed/encrypted along with the cookie value. Then, on a server-side
|
336
|
-
read, we verify the cookie-names and discard any attacked cookies.
|
387
|
+
*Tom Fakes*
|
337
388
|
|
338
|
-
|
339
|
-
writes cookies with the new purpose and expiry metadata embedded.
|
389
|
+
* Add `Vary: Accept` header when using `Accept` header for response.
|
340
390
|
|
341
|
-
|
391
|
+
For some requests like `/users/1`, Rails uses requests' `Accept`
|
392
|
+
header to determine what to return. And if we don't add `Vary`
|
393
|
+
in the response header, browsers might accidentally cache different
|
394
|
+
types of content, which would cause issues: e.g. javascript got displayed
|
395
|
+
instead of html content. This PR fixes these issues by adding `Vary: Accept`
|
396
|
+
in these types of requests. For more detailed problem description, please read:
|
342
397
|
|
343
|
-
|
398
|
+
https://github.com/rails/rails/pull/36213
|
344
399
|
|
345
|
-
|
346
|
-
multiple invocations are made and the types do not match:
|
400
|
+
Fixes #25842.
|
347
401
|
|
348
|
-
|
349
|
-
outer_type.js do
|
350
|
-
respond_to do |inner_type|
|
351
|
-
inner_type.html { render body: "HTML" }
|
352
|
-
end
|
353
|
-
end
|
354
|
-
end
|
402
|
+
*Stan Lo*
|
355
403
|
|
356
|
-
|
404
|
+
* Fix IntegrationTest `follow_redirect!` to follow redirection using the same HTTP verb when following
|
405
|
+
a 307 redirection.
|
357
406
|
|
358
|
-
*
|
407
|
+
*Edouard Chin*
|
359
408
|
|
360
|
-
|
361
|
-
without raising a `TypeError`:
|
409
|
+
* System tests require Capybara 3.26 or newer.
|
362
410
|
|
363
|
-
|
364
|
-
File.read(uploaded_file)
|
411
|
+
*George Claghorn*
|
365
412
|
|
366
|
-
|
413
|
+
* Reduced log noise handling ActionController::RoutingErrors.
|
367
414
|
|
368
|
-
*
|
415
|
+
*Alberto Fernández-Capel*
|
369
416
|
|
370
|
-
|
371
|
-
`get` method. This for example allows to set custom headers for the
|
372
|
-
redirection request to the server.
|
417
|
+
* Add DSL for configuring HTTP Feature Policy.
|
373
418
|
|
374
|
-
|
419
|
+
This new DSL provides a way to configure an HTTP Feature Policy at a
|
420
|
+
global or per-controller level. Full details of HTTP Feature Policy
|
421
|
+
specification and guidelines can be found at MDN:
|
375
422
|
|
376
|
-
|
423
|
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
|
377
424
|
|
378
|
-
|
425
|
+
Example global policy:
|
379
426
|
|
380
|
-
|
381
|
-
|
427
|
+
```ruby
|
428
|
+
Rails.application.config.feature_policy do |f|
|
429
|
+
f.camera :none
|
430
|
+
f.gyroscope :none
|
431
|
+
f.microphone :none
|
432
|
+
f.usb :none
|
433
|
+
f.fullscreen :self
|
434
|
+
f.payment :self, "https://secure.example.com"
|
435
|
+
end
|
436
|
+
```
|
382
437
|
|
383
|
-
|
438
|
+
Example controller level policy:
|
384
439
|
|
385
|
-
|
440
|
+
```ruby
|
441
|
+
class PagesController < ApplicationController
|
442
|
+
feature_policy do |p|
|
443
|
+
p.geolocation "https://example.com"
|
444
|
+
end
|
445
|
+
end
|
446
|
+
```
|
386
447
|
|
387
|
-
|
388
|
-
`.register_interceptor` method to get the processed exception, instead of
|
389
|
-
monkey patching DebugExceptions.
|
448
|
+
*Jacob Bednarz*
|
390
449
|
|
391
|
-
|
392
|
-
HypoteticalPlugin.capture_exception(request, exception)
|
393
|
-
end
|
450
|
+
* Add the ability to set the CSP nonce only to the specified directives.
|
394
451
|
|
395
|
-
|
452
|
+
Fixes #35137.
|
396
453
|
|
397
|
-
*
|
454
|
+
*Yuji Yaginuma*
|
398
455
|
|
399
|
-
|
456
|
+
* Keep part when scope option has value.
|
400
457
|
|
401
|
-
|
458
|
+
When a route was defined within an optional scope, if that route didn't
|
459
|
+
take parameters the scope was lost when using path helpers. This commit
|
460
|
+
ensures scope is kept both when the route takes parameters or when it
|
461
|
+
doesn't.
|
402
462
|
|
403
|
-
|
463
|
+
Fixes #33219.
|
404
464
|
|
405
|
-
*
|
465
|
+
*Alberto Almagro*
|
406
466
|
|
407
|
-
*
|
467
|
+
* Added `deep_transform_keys` and `deep_transform_keys!` methods to ActionController::Parameters.
|
408
468
|
|
409
|
-
*
|
469
|
+
*Gustavo Gutierrez*
|
410
470
|
|
411
|
-
*
|
412
|
-
|
471
|
+
* Calling `ActionController::Parameters#transform_keys`/`!` without a block now returns
|
472
|
+
an enumerator for the parameters instead of the underlying hash.
|
413
473
|
|
414
|
-
*
|
474
|
+
*Eugene Kenny*
|
415
475
|
|
416
|
-
*
|
476
|
+
* Fix strong parameters blocks all attributes even when only some keys are invalid (non-numerical).
|
477
|
+
It should only block invalid key's values instead.
|
417
478
|
|
418
|
-
*
|
479
|
+
*Stan Lo*
|
419
480
|
|
420
481
|
|
421
|
-
Please check [
|
482
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionpack/CHANGELOG.md) for previous changes.
|