actionpack 6.1.3.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 +102 -370
- 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/etag_with_template_digest.rb +1 -1
- 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 +16 -16
- data/lib/action_controller/metal/instrumentation.rb +55 -52
- data/lib/action_controller/metal/live.rb +52 -3
- data/lib/action_controller/metal/mime_responds.rb +3 -3
- data/lib/action_controller/metal/params_wrapper.rb +10 -9
- 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 +9 -2
- data/lib/action_controller.rb +2 -5
- data/lib/action_dispatch/http/cache.rb +18 -12
- 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/formatter.rb +2 -2
- 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/visitors.rb +1 -1
- 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 +10 -18
- 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/invalid_statement.text.erb +1 -0
- 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/polymorphic_routes.rb +8 -4
- 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 +18 -17
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,461 +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
|
|
7
|
+
Fixes #41145
|
5
8
|
|
6
|
-
|
9
|
+
*Aaron Lahey*
|
7
10
|
|
8
|
-
*
|
11
|
+
* Add `Middleware#delete!` to delete middleware or raise if not found.
|
9
12
|
|
10
|
-
|
13
|
+
`Middleware#delete!` works just like `Middleware#delete` but will
|
14
|
+
raise an error if the middleware isn't found.
|
11
15
|
|
16
|
+
*Alex Ghiculescu*, *Petrik de Heus*, *Junichi Sato*
|
12
17
|
|
13
|
-
|
18
|
+
* Raise error on unpermitted open redirects.
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
[CVE-2021-22881]
|
18
|
-
|
19
|
-
Thanks to @tktech (https://hackerone.com/tktech) for reporting this
|
20
|
-
issue and the patch!
|
21
|
-
|
22
|
-
*Aaron Patterson*
|
23
|
-
|
24
|
-
|
25
|
-
## Rails 6.1.2 (February 09, 2021) ##
|
26
|
-
|
27
|
-
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
28
|
-
|
29
|
-
*Janko Marohnić*
|
30
|
-
|
31
|
-
* Fix `fixture_file_upload` deprecation when `file_fixture_path` is a relative path.
|
32
|
-
|
33
|
-
*Eugene Kenny*
|
34
|
-
|
35
|
-
|
36
|
-
## Rails 6.1.1 (January 07, 2021) ##
|
37
|
-
|
38
|
-
* Fix nil translation key lookup in controllers/
|
39
|
-
|
40
|
-
*Jan Klimo*
|
41
|
-
|
42
|
-
* Quietly handle unknown HTTP methods in Action Dispatch SSL middleware.
|
43
|
-
|
44
|
-
*Alex Robbin*
|
45
|
-
|
46
|
-
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
47
|
-
|
48
|
-
*Alex Robbin*
|
49
|
-
|
50
|
-
|
51
|
-
## Rails 6.1.0 (December 09, 2020) ##
|
52
|
-
|
53
|
-
* Support for the HTTP header `Feature-Policy` has been revised to reflect
|
54
|
-
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).
|
55
|
-
|
56
|
-
```ruby
|
57
|
-
Rails.application.config.permissions_policy do |p|
|
58
|
-
p.camera :none
|
59
|
-
p.gyroscope :none
|
60
|
-
p.microphone :none
|
61
|
-
p.usb :none
|
62
|
-
p.fullscreen :self
|
63
|
-
p.payment :self, "https://secure-example.com"
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
*Julien Grillot*
|
68
|
-
|
69
|
-
* Allow `ActionDispatch::HostAuthorization` to exclude specific requests.
|
70
|
-
|
71
|
-
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.
|
72
|
-
|
73
|
-
*Chris Bisnett*
|
74
|
-
|
75
|
-
* Add `config.action_dispatch.request_id_header` to allow changing the name of
|
76
|
-
the unique X-Request-Id header
|
77
|
-
|
78
|
-
*Arlston Fernandes*
|
79
|
-
|
80
|
-
* Deprecate `config.action_dispatch.return_only_media_type_on_content_type`.
|
81
|
-
|
82
|
-
*Rafael Mendonça França*
|
83
|
-
|
84
|
-
* Change `ActionDispatch::Response#content_type` to return the full Content-Type header.
|
85
|
-
|
86
|
-
*Rafael Mendonça França*
|
87
|
-
|
88
|
-
* Remove deprecated `ActionDispatch::Http::ParameterFilter`.
|
89
|
-
|
90
|
-
*Rafael Mendonça França*
|
91
|
-
|
92
|
-
* Added support for exclusive no-store Cache-Control header.
|
93
|
-
|
94
|
-
If `no-store` is set on Cache-Control header it is exclusive (all other cache directives are dropped).
|
95
|
-
|
96
|
-
*Chris Kruger*
|
97
|
-
|
98
|
-
* Catch invalid UTF-8 parameters for POST requests and respond with BadRequest.
|
99
|
-
|
100
|
-
Additionally, perform `#set_binary_encoding` in `ActionDispatch::Http::Request#GET` and
|
101
|
-
`ActionDispatch::Http::Request#POST` prior to validating encoding.
|
102
|
-
|
103
|
-
*Adrianna Chang*
|
104
|
-
|
105
|
-
* Allow `assert_recognizes` routing assertions to work on mounted root routes.
|
20
|
+
Add `allow_other_host` options to `redirect_to`.
|
21
|
+
Opt in to this behaviour with `ActionController::Base.raise_on_open_redirects = true`.
|
106
22
|
|
107
23
|
*Gannon McGibbon*
|
108
24
|
|
109
|
-
*
|
110
|
-
|
111
|
-
*Alan Tan*, *Oz Ben-David*
|
112
|
-
|
113
|
-
* Fix `follow_redirect!` to follow redirection with same HTTP verb when following
|
114
|
-
a 308 redirection.
|
115
|
-
|
116
|
-
*Alan Tan*
|
117
|
-
|
118
|
-
* When multiple domains are specified for a cookie, a domain will now be
|
119
|
-
chosen only if it is equal to or is a superdomain of the request host.
|
120
|
-
|
121
|
-
*Jonathan Hefner*
|
122
|
-
|
123
|
-
* `ActionDispatch::Static` handles precompiled Brotli (.br) files.
|
124
|
-
|
125
|
-
Adds to existing support for precompiled gzip (.gz) files.
|
126
|
-
Brotli files are preferred due to much better compression.
|
127
|
-
|
128
|
-
When the browser requests /some.js with `Accept-Encoding: br`,
|
129
|
-
we check for public/some.js.br and serve that file, if present, with
|
130
|
-
`Content-Encoding: br` and `Vary: Accept-Encoding` headers.
|
131
|
-
|
132
|
-
*Ryan Edward Hall*, *Jeremy Daer*
|
133
|
-
|
134
|
-
* Add raise_on_missing_translations support for controllers.
|
135
|
-
|
136
|
-
This configuration determines whether an error should be raised for missing translations.
|
137
|
-
It can be enabled through `config.i18n.raise_on_missing_translations`. Note that described
|
138
|
-
configuration also affects raising error for missing translations in views.
|
139
|
-
|
140
|
-
*fatkodima*
|
141
|
-
|
142
|
-
* Added `compact` and `compact!` to `ActionController::Parameters`.
|
143
|
-
|
144
|
-
*Eugene Kenny*
|
25
|
+
* Deprecate `poltergeist` and `webkit` (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1). Add `cuprite` instead.
|
145
26
|
|
146
|
-
|
147
|
-
without passing a block now returns an enumerator.
|
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.
|
148
28
|
|
149
|
-
|
29
|
+
[Cuprite](https://github.com/rubycdp/cuprite) is a good alternative to Poltergeist. Some guide descriptions are replaced from Poltergeist to Cuprite.
|
150
30
|
|
151
|
-
*
|
31
|
+
*Yusuke Iwaki*
|
152
32
|
|
153
|
-
|
154
|
-
You can change your existing code as follow:
|
33
|
+
* Exclude additional flash types from `ActionController::Base.action_methods`.
|
155
34
|
|
156
|
-
|
157
|
-
|
158
|
-
fixture_file_upload('files/dog.png')
|
159
|
-
|
160
|
-
# After
|
161
|
-
fixture_file_upload('dog.png')
|
162
|
-
```
|
163
|
-
|
164
|
-
*Edouard Chin*
|
165
|
-
|
166
|
-
* Remove deprecated `force_ssl` at the controller level.
|
35
|
+
Ensures that additional flash types defined on ActionController::Base subclasses
|
36
|
+
are not listed as actions on that controller.
|
167
37
|
|
168
|
-
|
38
|
+
class MyController < ApplicationController
|
39
|
+
add_flash_types :hype
|
40
|
+
end
|
169
41
|
|
170
|
-
|
171
|
-
strings/symbols with `String#constantize` instead of `require_dependency`.
|
42
|
+
MyController.action_methods.include?('hype') # => false
|
172
43
|
|
173
|
-
|
174
|
-
always pass a module object:
|
44
|
+
*Gavin Morrice*
|
175
45
|
|
176
|
-
|
177
|
-
helper UtilsHelper
|
178
|
-
```
|
46
|
+
* OpenSSL constants are now used for Digest computations.
|
179
47
|
|
180
|
-
|
181
|
-
is received, `helper` just manipulates and inflects the argument to obtain
|
182
|
-
that same module object.
|
48
|
+
*Dirkjan Bussink*
|
183
49
|
|
184
|
-
|
50
|
+
* Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module.
|
185
51
|
|
186
|
-
|
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.
|
187
53
|
|
188
|
-
*
|
54
|
+
*Tadas Sasnauskas*
|
189
55
|
|
190
|
-
*
|
191
|
-
|
56
|
+
* Configuration setting to skip logging an uncaught exception backtrace when the exception is
|
57
|
+
present in `rescued_responses`.
|
192
58
|
|
193
|
-
|
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.
|
194
63
|
|
195
|
-
*
|
64
|
+
*Alexander Azarov*, *Mike Dalessio*
|
196
65
|
|
197
|
-
|
198
|
-
them difficult to deal with. For example, the common practice of sending
|
199
|
-
the CSRF token to a browser in a client-readable cookie does not work properly
|
200
|
-
out of the box: the value has to be url-encoded and decoded to survive transport.
|
66
|
+
* Ignore file fixtures on `db:fixtures:load`.
|
201
67
|
|
202
|
-
|
203
|
-
to transport. Validation accepts both urlsafe tokens, and strict-encoded tokens
|
204
|
-
for backwards compatibility.
|
68
|
+
*Kevin Sjöberg*
|
205
69
|
|
206
|
-
|
70
|
+
* Fix ActionController::Live controller test deadlocks by removing the body buffer size limit for tests.
|
207
71
|
|
208
|
-
*
|
72
|
+
*Dylan Thacker-Smith*
|
209
73
|
|
210
|
-
|
211
|
-
both old and new instances during deployment. Users may be served by a
|
212
|
-
new instance and then by an old instance.
|
74
|
+
* New `ActionController::ConditionalGet#no_store` method to set HTTP cache control `no-store` directive.
|
213
75
|
|
214
|
-
|
215
|
-
to `:hybrid` or the server changes `use_authenticated_cookie_encryption`
|
216
|
-
from `false` to `true`, users may lose their sessions if they access the
|
217
|
-
server during deployment.
|
76
|
+
*Tadas Sasnauskas*
|
218
77
|
|
219
|
-
|
220
|
-
deployment, ensuring compatibility on both old and new instances.
|
78
|
+
* Drop support for the `SERVER_ADDR` header.
|
221
79
|
|
222
|
-
|
80
|
+
Following up https://github.com/rack/rack/pull/1573 and https://github.com/rails/rails/pull/42349.
|
223
81
|
|
224
|
-
*
|
82
|
+
*Ricardo Díaz*
|
225
83
|
|
226
|
-
|
227
|
-
Now, the furthest proxy site is used. e.g.: It now gives an ip address when using curl from the load balancer.
|
84
|
+
* Set session options when initializing a basic session.
|
228
85
|
|
229
|
-
*
|
230
|
-
|
231
|
-
* Fix possible information leak / session hijacking vulnerability.
|
86
|
+
*Gannon McGibbon*
|
232
87
|
|
233
|
-
|
234
|
-
gem dalli to be updated as well.
|
88
|
+
* Add `cache_control: {}` option to `fresh_when` and `stale?`.
|
235
89
|
|
236
|
-
|
90
|
+
Works as a shortcut to set `response.cache_control` with the above methods.
|
237
91
|
|
238
|
-
*
|
92
|
+
*Jacopo Beschi*
|
239
93
|
|
240
|
-
|
241
|
-
meant it had its own copy of `@assertions`. This prevented the assertions
|
242
|
-
from being correctly counted and reported.
|
94
|
+
* Writing into a disabled session will now raise an error.
|
243
95
|
|
244
|
-
|
245
|
-
root session.
|
96
|
+
Previously when no session store was set, writing into the session would silently fail.
|
246
97
|
|
247
|
-
|
98
|
+
*Jean Boussier*
|
248
99
|
|
249
|
-
|
100
|
+
* Add support for 'require-trusted-types-for' and 'trusted-types' headers.
|
250
101
|
|
251
|
-
|
102
|
+
Fixes #42034.
|
252
103
|
|
253
|
-
|
254
|
-
where cookies won't be sent by browsers in cross-site POST requests when set to `:lax`.
|
104
|
+
*lfalcao*
|
255
105
|
|
256
|
-
|
106
|
+
* Remove inline styles and address basic accessibility issues on rescue templates.
|
257
107
|
|
258
|
-
|
108
|
+
*Jacob Herrington*
|
259
109
|
|
260
|
-
|
110
|
+
* Add support for 'private, no-store' Cache-Control headers.
|
261
111
|
|
262
|
-
|
112
|
+
Previously, 'no-store' was exclusive; no other directives could be specified.
|
263
113
|
|
264
|
-
|
114
|
+
*Alex Smith*
|
265
115
|
|
266
|
-
|
116
|
+
* Expand payload of `unpermitted_parameters.action_controller` instrumentation to allow subscribers to
|
117
|
+
know which controller action received unpermitted parameters.
|
267
118
|
|
268
|
-
*
|
119
|
+
*bbuchalter*
|
269
120
|
|
270
|
-
|
271
|
-
https://github.com/rails/routing_concerns was a better approach. Turned out
|
272
|
-
that this wasn't fully the case and loading external route files from the router
|
273
|
-
can be helpful for applications with a really large set of routes.
|
274
|
-
Without this feature, application needs to implement routes reloading
|
275
|
-
themselves and it's not straightforward.
|
121
|
+
* Add `ActionController::Live#send_stream` that makes it more convenient to send generated streams:
|
276
122
|
|
277
123
|
```ruby
|
278
|
-
|
279
|
-
|
280
|
-
Rails.application.routes.draw do
|
281
|
-
draw(:admin)
|
282
|
-
end
|
283
|
-
|
284
|
-
# config/routes/admin.rb
|
285
|
-
|
286
|
-
get :foo, to: 'foo#bar'
|
287
|
-
```
|
288
|
-
|
289
|
-
*Yehuda Katz*, *Edouard Chin*
|
124
|
+
send_stream(filename: "subscribers.csv") do |stream|
|
125
|
+
stream.writeln "email_address,updated_at"
|
290
126
|
|
291
|
-
|
292
|
-
|
293
|
-
*glaszig*
|
294
|
-
|
295
|
-
* `redirect_to.action_controller` notifications now include the `ActionDispatch::Request` in
|
296
|
-
their payloads as `:request`.
|
297
|
-
|
298
|
-
*Austin Story*
|
299
|
-
|
300
|
-
* `respond_to#any` no longer returns a response's Content-Type based on the
|
301
|
-
request format but based on the block given.
|
302
|
-
|
303
|
-
Example:
|
304
|
-
|
305
|
-
```ruby
|
306
|
-
def my_action
|
307
|
-
respond_to do |format|
|
308
|
-
format.any { render(json: { foo: 'bar' }) }
|
309
|
-
end
|
127
|
+
@subscribers.find_each do |subscriber|
|
128
|
+
stream.writeln [ subscriber.email_address, subscriber.updated_at ].join(",")
|
310
129
|
end
|
311
|
-
|
312
|
-
get('my_action.csv')
|
313
|
-
```
|
314
|
-
|
315
|
-
The previous behaviour was to respond with a `text/csv` Content-Type which
|
316
|
-
is inaccurate since a JSON response is being rendered.
|
317
|
-
|
318
|
-
Now it correctly returns a `application/json` Content-Type.
|
319
|
-
|
320
|
-
*Edouard Chin*
|
321
|
-
|
322
|
-
* Replaces (back)slashes in failure screenshot image paths with dashes.
|
323
|
-
|
324
|
-
If a failed test case contained a slash or a backslash, a screenshot would be created in a
|
325
|
-
nested directory, causing issues with `tmp:clear`.
|
326
|
-
|
327
|
-
*Damir Zekic*
|
328
|
-
|
329
|
-
* Add `params.member?` to mimic Hash behavior.
|
330
|
-
|
331
|
-
*Younes Serraj*
|
332
|
-
|
333
|
-
* `process_action.action_controller` notifications now include the following in their payloads:
|
334
|
-
|
335
|
-
* `:request` - the `ActionDispatch::Request`
|
336
|
-
* `:response` - the `ActionDispatch::Response`
|
337
|
-
|
338
|
-
*George Claghorn*
|
339
|
-
|
340
|
-
* Updated `ActionDispatch::Request.remote_ip` setter to clear set the instance
|
341
|
-
`remote_ip` to `nil` before setting the header that the value is derived
|
342
|
-
from.
|
343
|
-
|
344
|
-
Fixes #37383.
|
345
|
-
|
346
|
-
*Norm Provost*
|
347
|
-
|
348
|
-
* `ActionController::Base.log_at` allows setting a different log level per request.
|
349
|
-
|
350
|
-
```ruby
|
351
|
-
# Use the debug level if a particular cookie is set.
|
352
|
-
class ApplicationController < ActionController::Base
|
353
|
-
log_at :debug, if: -> { cookies[:debug] }
|
354
130
|
end
|
355
131
|
```
|
356
132
|
|
357
|
-
*
|
358
|
-
|
359
|
-
* Allow system test screen shots to be taken more than once in
|
360
|
-
a test by prefixing the file name with an incrementing counter.
|
361
|
-
|
362
|
-
Add an environment variable `RAILS_SYSTEM_TESTING_SCREENSHOT_HTML` to
|
363
|
-
enable saving of HTML during a screenshot in addition to the image.
|
364
|
-
This uses the same image name, with the extension replaced with `.html`
|
365
|
-
|
366
|
-
*Tom Fakes*
|
367
|
-
|
368
|
-
* Add `Vary: Accept` header when using `Accept` header for response.
|
369
|
-
|
370
|
-
For some requests like `/users/1`, Rails uses requests' `Accept`
|
371
|
-
header to determine what to return. And if we don't add `Vary`
|
372
|
-
in the response header, browsers might accidentally cache different
|
373
|
-
types of content, which would cause issues: e.g. javascript got displayed
|
374
|
-
instead of html content. This PR fixes these issues by adding `Vary: Accept`
|
375
|
-
in these types of requests. For more detailed problem description, please read:
|
133
|
+
*DHH*
|
376
134
|
|
377
|
-
|
135
|
+
* Add `ActionController::Live::Buffer#writeln` to write a line to the stream with a newline included.
|
378
136
|
|
379
|
-
|
137
|
+
*DHH*
|
380
138
|
|
381
|
-
|
139
|
+
* `ActionDispatch::Request#content_type` now returned Content-Type header as it is.
|
382
140
|
|
383
|
-
|
384
|
-
|
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.
|
385
143
|
|
386
|
-
|
144
|
+
If you want just MIME type, please use `ActionDispatch::Request#media_type` instead.
|
387
145
|
|
388
|
-
|
389
|
-
|
390
|
-
*George Claghorn*
|
391
|
-
|
392
|
-
* Reduced log noise handling ActionController::RoutingErrors.
|
393
|
-
|
394
|
-
*Alberto Fernández-Capel*
|
395
|
-
|
396
|
-
* Add DSL for configuring HTTP Feature Policy.
|
397
|
-
|
398
|
-
This new DSL provides a way to configure an HTTP Feature Policy at a
|
399
|
-
global or per-controller level. Full details of HTTP Feature Policy
|
400
|
-
specification and guidelines can be found at MDN:
|
401
|
-
|
402
|
-
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
|
403
|
-
|
404
|
-
Example global policy:
|
146
|
+
Before:
|
405
147
|
|
406
148
|
```ruby
|
407
|
-
|
408
|
-
|
409
|
-
f.gyroscope :none
|
410
|
-
f.microphone :none
|
411
|
-
f.usb :none
|
412
|
-
f.fullscreen :self
|
413
|
-
f.payment :self, "https://secure.example.com"
|
414
|
-
end
|
149
|
+
request = ActionDispatch::Request.new("CONTENT_TYPE" => "text/csv; header=present; charset=utf-16", "REQUEST_METHOD" => "GET")
|
150
|
+
request.content_type #=> "text/csv"
|
415
151
|
```
|
416
152
|
|
417
|
-
|
153
|
+
After:
|
418
154
|
|
419
155
|
```ruby
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
end
|
424
|
-
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"
|
425
159
|
```
|
426
160
|
|
427
|
-
*
|
161
|
+
*Rafael Mendonça França*
|
428
162
|
|
429
|
-
*
|
163
|
+
* Change `ActionDispatch::Request#media_type` to return `nil` when the request don't have a `Content-Type` header.
|
430
164
|
|
431
|
-
|
165
|
+
*Rafael Mendonça França*
|
432
166
|
|
433
|
-
|
167
|
+
* Fix error in `ActionController::LogSubscriber` that would happen when throwing inside a controller action.
|
434
168
|
|
435
|
-
*
|
169
|
+
*Janko Marohnić*
|
436
170
|
|
437
|
-
|
438
|
-
take parameters the scope was lost when using path helpers. This commit
|
439
|
-
ensures scope is kept both when the route takes parameters or when it
|
440
|
-
doesn't.
|
171
|
+
* Allow anything with `#to_str` (like `Addressable::URI`) as a `redirect_to` location.
|
441
172
|
|
442
|
-
|
173
|
+
*ojab*
|
443
174
|
|
444
|
-
|
175
|
+
* Change the request method to a `GET` when passing failed requests down to `config.exceptions_app`.
|
445
176
|
|
446
|
-
*
|
177
|
+
*Alex Robbin*
|
447
178
|
|
448
|
-
|
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.
|
449
182
|
|
450
|
-
|
451
|
-
an enumerator for the parameters instead of the underlying hash.
|
183
|
+
Fixes #40772.
|
452
184
|
|
453
|
-
*
|
185
|
+
*Christian Sutter*
|
454
186
|
|
455
|
-
*
|
456
|
-
|
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.
|
457
189
|
|
458
|
-
*
|
190
|
+
*DHH*
|
459
191
|
|
460
192
|
|
461
|
-
Please check [6-
|
193
|
+
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionpack/CHANGELOG.md) for previous changes.
|