actionpack 5.2.2.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +197 -274
- data/MIT-LICENSE +1 -1
- data/README.rdoc +3 -2
- data/lib/abstract_controller/base.rb +4 -2
- data/lib/abstract_controller/caching/fragments.rb +6 -22
- data/lib/abstract_controller/callbacks.rb +12 -0
- data/lib/abstract_controller/collector.rb +1 -1
- data/lib/abstract_controller/helpers.rb +2 -2
- data/lib/abstract_controller/railties/routes_helpers.rb +1 -1
- data/lib/abstract_controller/translation.rb +1 -0
- data/lib/action_controller.rb +5 -1
- data/lib/action_controller/api.rb +2 -1
- data/lib/action_controller/base.rb +2 -7
- data/lib/action_controller/caching.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +8 -5
- data/lib/action_controller/metal.rb +3 -3
- data/lib/action_controller/metal/basic_implicit_render.rb +1 -1
- data/lib/action_controller/metal/conditional_get.rb +9 -3
- data/lib/action_controller/metal/data_streaming.rb +5 -6
- data/lib/action_controller/metal/default_headers.rb +17 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +1 -1
- data/lib/action_controller/metal/exceptions.rb +23 -2
- data/lib/action_controller/metal/flash.rb +5 -5
- data/lib/action_controller/metal/force_ssl.rb +15 -56
- data/lib/action_controller/metal/head.rb +1 -1
- data/lib/action_controller/metal/helpers.rb +3 -4
- data/lib/action_controller/metal/http_authentication.rb +20 -21
- data/lib/action_controller/metal/implicit_render.rb +4 -14
- data/lib/action_controller/metal/instrumentation.rb +3 -5
- data/lib/action_controller/metal/live.rb +29 -27
- data/lib/action_controller/metal/mime_responds.rb +13 -2
- data/lib/action_controller/metal/params_wrapper.rb +18 -14
- data/lib/action_controller/metal/redirecting.rb +5 -5
- data/lib/action_controller/metal/renderers.rb +4 -4
- data/lib/action_controller/metal/rendering.rb +2 -2
- data/lib/action_controller/metal/request_forgery_protection.rb +23 -12
- data/lib/action_controller/metal/strong_parameters.rb +63 -44
- data/lib/action_controller/metal/url_for.rb +1 -1
- data/lib/action_controller/railties/helpers.rb +1 -1
- data/lib/action_controller/renderer.rb +16 -3
- data/lib/action_controller/template_assertions.rb +1 -1
- data/lib/action_controller/test_case.rb +6 -8
- data/lib/action_dispatch.rb +4 -2
- data/lib/action_dispatch/http/cache.rb +20 -14
- data/lib/action_dispatch/http/content_disposition.rb +45 -0
- data/lib/action_dispatch/http/content_security_policy.rb +28 -16
- data/lib/action_dispatch/http/filter_parameters.rb +8 -6
- data/lib/action_dispatch/http/filter_redirect.rb +1 -1
- data/lib/action_dispatch/http/headers.rb +1 -1
- data/lib/action_dispatch/http/mime_negotiation.rb +7 -5
- data/lib/action_dispatch/http/mime_type.rb +14 -6
- data/lib/action_dispatch/http/parameter_filter.rb +5 -79
- data/lib/action_dispatch/http/parameters.rb +13 -3
- data/lib/action_dispatch/http/request.rb +10 -13
- data/lib/action_dispatch/http/response.rb +40 -20
- data/lib/action_dispatch/http/upload.rb +9 -1
- data/lib/action_dispatch/http/url.rb +81 -81
- data/lib/action_dispatch/journey/formatter.rb +2 -2
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -2
- data/lib/action_dispatch/journey/nodes/node.rb +9 -8
- data/lib/action_dispatch/journey/path/pattern.rb +8 -3
- data/lib/action_dispatch/journey/route.rb +5 -4
- data/lib/action_dispatch/journey/router.rb +0 -3
- data/lib/action_dispatch/journey/router/utils.rb +10 -10
- data/lib/action_dispatch/journey/routes.rb +0 -1
- data/lib/action_dispatch/journey/scanner.rb +11 -4
- data/lib/action_dispatch/journey/visitors.rb +1 -1
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +39 -0
- data/lib/action_dispatch/middleware/callbacks.rb +2 -4
- data/lib/action_dispatch/middleware/cookies.rb +52 -74
- data/lib/action_dispatch/middleware/debug_exceptions.rb +39 -59
- data/lib/action_dispatch/middleware/debug_locks.rb +5 -5
- data/lib/action_dispatch/middleware/debug_view.rb +68 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +49 -15
- data/lib/action_dispatch/middleware/flash.rb +1 -1
- data/lib/action_dispatch/middleware/host_authorization.rb +103 -0
- data/lib/action_dispatch/middleware/public_exceptions.rb +6 -2
- data/lib/action_dispatch/middleware/remote_ip.rb +9 -11
- data/lib/action_dispatch/middleware/request_id.rb +2 -2
- data/lib/action_dispatch/middleware/session/cookie_store.rb +1 -6
- data/lib/action_dispatch/middleware/show_exceptions.rb +1 -1
- data/lib/action_dispatch/middleware/ssl.rb +8 -8
- data/lib/action_dispatch/middleware/stack.rb +34 -2
- data/lib/action_dispatch/middleware/static.rb +5 -6
- data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
- data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +3 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +4 -2
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +45 -35
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +7 -0
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +5 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +26 -4
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +7 -4
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +4 -2
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +4 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +19 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb +3 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +3 -0
- data/lib/action_dispatch/railtie.rb +7 -2
- data/lib/action_dispatch/request/session.rb +8 -0
- data/lib/action_dispatch/routing.rb +21 -20
- data/lib/action_dispatch/routing/inspector.rb +99 -50
- data/lib/action_dispatch/routing/mapper.rb +61 -39
- data/lib/action_dispatch/routing/polymorphic_routes.rb +3 -4
- data/lib/action_dispatch/routing/route_set.rb +24 -27
- data/lib/action_dispatch/routing/url_for.rb +1 -0
- data/lib/action_dispatch/system_test_case.rb +44 -5
- data/lib/action_dispatch/system_testing/browser.rb +38 -7
- data/lib/action_dispatch/system_testing/driver.rb +10 -1
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +6 -5
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +7 -6
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/assertions/response.rb +2 -3
- data/lib/action_dispatch/testing/assertions/routing.rb +15 -3
- data/lib/action_dispatch/testing/integration.rb +12 -5
- data/lib/action_dispatch/testing/request_encoder.rb +2 -2
- data/lib/action_dispatch/testing/test_process.rb +2 -2
- data/lib/action_dispatch/testing/test_response.rb +4 -32
- data/lib/action_pack.rb +1 -1
- data/lib/action_pack/gem_version.rb +3 -3
- metadata +29 -16
- data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f7246f24a9df271c75ef6414d3508051e6081939be38345b3eecaf2b0de687e
|
|
4
|
+
data.tar.gz: 37136a7416097b294ce52c275ee5a752fe37f42e0caedb04328d1484ba05b852
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66a86fdd9a72d5e8c6e243a47092a25f92a3d702fe6463cc144919a75433a7309105d9f76fc54b29d697d41e02e6e57972bbb3800e7c190bcf30b5252f25c8c3
|
|
7
|
+
data.tar.gz: 751c2c6c7b5c5d87b7f2959d22853b2427170b19d8ae8395d3ee17070761812ef37705e9b23c59dc6acd057c9caa2b3b24a2544e61a8a3eb9bc357bfd03ab0d8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,412 +1,335 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 6.0.2 (December 13, 2019) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Rails 5.2.2 (December 04, 2018) ##
|
|
7
|
-
|
|
8
|
-
* Reset Capybara sessions if failed system test screenshot raising an exception.
|
|
9
|
-
|
|
10
|
-
Reset Capybara sessions if `take_failed_screenshot` raise exception
|
|
11
|
-
in system test `after_teardown`.
|
|
12
|
-
|
|
13
|
-
*Maxim Perepelitsa*
|
|
14
|
-
|
|
15
|
-
* Use request object for context if there's no controller
|
|
16
|
-
|
|
17
|
-
There is no controller instance when using a redirect route or a
|
|
18
|
-
mounted rack application so pass the request object as the context
|
|
19
|
-
when resolving dynamic CSP sources in this scenario.
|
|
20
|
-
|
|
21
|
-
Fixes #34200.
|
|
22
|
-
|
|
23
|
-
*Andrew White*
|
|
24
|
-
|
|
25
|
-
* Apply mapping to symbols returned from dynamic CSP sources
|
|
26
|
-
|
|
27
|
-
Previously if a dynamic source returned a symbol such as :self it
|
|
28
|
-
would be converted to a string implicity, e.g:
|
|
29
|
-
|
|
30
|
-
policy.default_src -> { :self }
|
|
31
|
-
|
|
32
|
-
would generate the header:
|
|
3
|
+
* Allow using mountable engine route helpers in System Tests.
|
|
33
4
|
|
|
34
|
-
|
|
5
|
+
*Chalo Fernandez*
|
|
35
6
|
|
|
36
|
-
and now it generates:
|
|
37
7
|
|
|
38
|
-
|
|
8
|
+
## Rails 6.0.1 (November 5, 2019) ##
|
|
39
9
|
|
|
40
|
-
|
|
10
|
+
* `ActionDispatch::SystemTestCase` now inherits from `ActiveSupport::TestCase`
|
|
11
|
+
rather than `ActionDispatch::IntegrationTest`. This permits running jobs in
|
|
12
|
+
system tests.
|
|
41
13
|
|
|
42
|
-
*
|
|
14
|
+
*George Claghorn*, *Edouard Chin*
|
|
43
15
|
|
|
44
|
-
|
|
16
|
+
* Registered MIME types may contain extra flags:
|
|
45
17
|
|
|
46
|
-
|
|
18
|
+
```ruby
|
|
19
|
+
Mime::Type.register "text/html; fragment", :html_fragment
|
|
20
|
+
```
|
|
47
21
|
|
|
48
|
-
*
|
|
22
|
+
*Aaron Patterson*
|
|
49
23
|
|
|
50
24
|
|
|
51
|
-
## Rails
|
|
25
|
+
## Rails 6.0.0 (August 16, 2019) ##
|
|
52
26
|
|
|
53
27
|
* No changes.
|
|
54
28
|
|
|
55
29
|
|
|
56
|
-
## Rails
|
|
30
|
+
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
|
57
31
|
|
|
58
|
-
*
|
|
32
|
+
* Add the ability to set the CSP nonce only to the specified directives.
|
|
59
33
|
|
|
60
|
-
|
|
61
|
-
there are none.
|
|
34
|
+
Fixes #35137.
|
|
62
35
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
get foos_url, as: :json
|
|
66
|
-
|
|
67
|
-
*Alireza Bashiri*
|
|
68
|
-
|
|
69
|
-
* Ensure `ActionController::Parameters#transform_values` and
|
|
70
|
-
`ActionController::Parameters#transform_values!` converts hashes into
|
|
71
|
-
parameters.
|
|
72
|
-
|
|
73
|
-
*Kevin Sjöberg*
|
|
74
|
-
|
|
75
|
-
* Fix strong parameters `permit!` with nested arrays.
|
|
76
|
-
|
|
77
|
-
Given:
|
|
78
|
-
```
|
|
79
|
-
params = ActionController::Parameters.new(nested_arrays: [[{ x: 2, y: 3 }, { x: 21, y: 42 }]])
|
|
80
|
-
params.permit!
|
|
81
|
-
```
|
|
36
|
+
*Yuji Yaginuma*
|
|
82
37
|
|
|
83
|
-
|
|
38
|
+
* Keep part when scope option has value.
|
|
84
39
|
|
|
85
|
-
|
|
40
|
+
When a route was defined within an optional scope, if that route didn't
|
|
41
|
+
take parameters the scope was lost when using path helpers. This commit
|
|
42
|
+
ensures scope is kept both when the route takes parameters or when it
|
|
43
|
+
doesn't.
|
|
86
44
|
|
|
87
|
-
|
|
88
|
-
`ActionController::TestCase` subclasses.
|
|
45
|
+
Fixes #33219
|
|
89
46
|
|
|
90
|
-
*
|
|
47
|
+
*Alberto Almagro*
|
|
91
48
|
|
|
92
|
-
*
|
|
49
|
+
* Change `ActionDispatch::Response#content_type` to return Content-Type header as it is.
|
|
93
50
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
51
|
+
Previously, `ActionDispatch::Response#content_type` returned value does NOT
|
|
52
|
+
contain charset part. This behavior changed to returned Content-Type header
|
|
53
|
+
containing charset part as it is.
|
|
97
54
|
|
|
98
|
-
|
|
55
|
+
If you want just MIME type, please use `ActionDispatch::Response#media_type`
|
|
56
|
+
instead.
|
|
99
57
|
|
|
100
|
-
|
|
58
|
+
Enable `action_dispatch.return_only_media_type_on_content_type` to use this change.
|
|
59
|
+
If not enabled, `ActionDispatch::Response#content_type` returns the same
|
|
60
|
+
value as before version, but its behavior is deprecate.
|
|
101
61
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*Stefan Wrobel*
|
|
62
|
+
*Yuji Yaginuma*
|
|
105
63
|
|
|
106
|
-
*
|
|
64
|
+
* Calling `ActionController::Parameters#transform_keys/!` without a block now returns
|
|
65
|
+
an enumerator for the parameters instead of the underlying hash.
|
|
107
66
|
|
|
108
|
-
*
|
|
67
|
+
*Eugene Kenny*
|
|
109
68
|
|
|
69
|
+
* Fix a bug where DebugExceptions throws an error when malformed query parameters are provided
|
|
110
70
|
|
|
111
|
-
|
|
71
|
+
*Yuki Nishijima*, *Stan Lo*
|
|
112
72
|
|
|
113
|
-
* Check exclude before flagging cookies as secure.
|
|
114
73
|
|
|
115
|
-
|
|
74
|
+
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
|
116
75
|
|
|
117
|
-
*
|
|
76
|
+
* Make system tests take a failed screenshot in a `before_teardown` hook
|
|
77
|
+
rather than an `after_teardown` hook.
|
|
118
78
|
|
|
119
|
-
This
|
|
120
|
-
|
|
79
|
+
This helps minimize the time gap between when an assertion fails and when
|
|
80
|
+
the screenshot is taken (reducing the time in which the page could have
|
|
81
|
+
been dynamically updated after the assertion failed).
|
|
121
82
|
|
|
122
|
-
*
|
|
83
|
+
*Richard Macklin*
|
|
123
84
|
|
|
124
|
-
*
|
|
85
|
+
* Introduce `ActionDispatch::ActionableExceptions`.
|
|
125
86
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
end
|
|
87
|
+
The `ActionDispatch::ActionableExceptions` middleware dispatches actions
|
|
88
|
+
from `ActiveSupport::ActionableError` descendants.
|
|
129
89
|
|
|
130
|
-
|
|
90
|
+
Actionable errors let's you dispatch actions from Rails' error pages.
|
|
131
91
|
|
|
132
|
-
*
|
|
133
|
-
Add alias method `to_h` to `to_hash` for `session`.
|
|
92
|
+
*Vipul A M*, *Yao Jie*, *Genadi Samokovarov*
|
|
134
93
|
|
|
135
|
-
|
|
94
|
+
* Raise an `ArgumentError` if a resource custom param contains a colon (`:`).
|
|
136
95
|
|
|
137
|
-
|
|
138
|
-
to meet the minimum max-age requirement for https://hstspreload.org/.
|
|
96
|
+
After this change it's not possible anymore to configure routes like this:
|
|
139
97
|
|
|
140
|
-
|
|
98
|
+
```
|
|
99
|
+
routes.draw do
|
|
100
|
+
resources :users, param: 'name/:sneaky'
|
|
101
|
+
end
|
|
102
|
+
```
|
|
141
103
|
|
|
142
|
-
|
|
104
|
+
Fixes #30467.
|
|
143
105
|
|
|
144
|
-
|
|
145
|
-
normally requires the script-src attribute of the content security
|
|
146
|
-
policy to include 'unsafe-inline'.
|
|
106
|
+
*Josua Schmid*
|
|
147
107
|
|
|
148
|
-
To work around this we generate a per-request nonce value that is
|
|
149
|
-
embedded in a meta tag in a similar fashion to how CSRF protection
|
|
150
|
-
embeds its token in a meta tag. The UJS library can then read the
|
|
151
|
-
nonce value and set it on the dynamically generated script tag to
|
|
152
|
-
enable it to execute without needing 'unsafe-inline' enabled.
|
|
153
108
|
|
|
154
|
-
|
|
155
|
-
user generated content in someway then it may be possible to exploit
|
|
156
|
-
an XSS vulnerability which can take advantage of the nonce. It is
|
|
157
|
-
however an improvement on a blanket permission for inline scripts.
|
|
109
|
+
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
|
158
110
|
|
|
159
|
-
|
|
160
|
-
using `nonce: true` to set the nonce value on the tag, e.g
|
|
111
|
+
* No changes.
|
|
161
112
|
|
|
162
|
-
<%= javascript_tag nonce: true do %>
|
|
163
|
-
alert('Hello, World!');
|
|
164
|
-
<% end %>
|
|
165
113
|
|
|
166
|
-
|
|
114
|
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
|
|
167
115
|
|
|
168
|
-
|
|
116
|
+
* Make debug exceptions works in an environment where ActiveStorage is not loaded.
|
|
169
117
|
|
|
170
|
-
*
|
|
118
|
+
*Tomoyuki Kurosawa*
|
|
171
119
|
|
|
172
|
-
|
|
120
|
+
* `ActionDispatch::SystemTestCase.driven_by` can now be called with a block
|
|
121
|
+
to define specific browser capabilities.
|
|
173
122
|
|
|
174
|
-
*
|
|
123
|
+
*Edouard Chin*
|
|
175
124
|
|
|
176
|
-
*Guillermo Iguaran*
|
|
177
125
|
|
|
178
|
-
|
|
179
|
-
user haven't specified manually another server.
|
|
126
|
+
## Rails 6.0.0.beta1 (January 18, 2019) ##
|
|
180
127
|
|
|
181
|
-
|
|
128
|
+
* Remove deprecated `fragment_cache_key` helper in favor of `combined_fragment_cache_key`.
|
|
182
129
|
|
|
183
|
-
*
|
|
184
|
-
default headers set.
|
|
130
|
+
*Rafael Mendonça França*
|
|
185
131
|
|
|
186
|
-
|
|
132
|
+
* Remove deprecated methods in `ActionDispatch::TestResponse`.
|
|
187
133
|
|
|
188
|
-
|
|
134
|
+
`#success?`, `missing?` and `error?` were deprecated in Rails 5.2 in favor of
|
|
135
|
+
`#successful?`, `not_found?` and `server_error?`.
|
|
189
136
|
|
|
190
|
-
*
|
|
137
|
+
*Rafael Mendonça França*
|
|
191
138
|
|
|
192
|
-
*
|
|
139
|
+
* Introduce `ActionDispatch::HostAuthorization`.
|
|
193
140
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
render the image. Other terminals, like those on Ubuntu, cannot handle the image
|
|
197
|
-
inline, but also don't handle it gracefully and instead of outputting the file
|
|
198
|
-
path, it dumps binary into the terminal.
|
|
141
|
+
This is a new middleware that guards against DNS rebinding attacks by
|
|
142
|
+
explicitly permitting the hosts a request can be made to.
|
|
199
143
|
|
|
200
|
-
|
|
144
|
+
Each host is checked with the case operator (`#===`) to support `Regexp`,
|
|
145
|
+
`Proc`, `IPAddr` and custom objects as host allowances.
|
|
201
146
|
|
|
202
|
-
*
|
|
147
|
+
*Genadi Samokovarov*
|
|
203
148
|
|
|
204
|
-
*
|
|
149
|
+
* Allow using `parsed_body` in `ActionController::TestCase`.
|
|
205
150
|
|
|
206
|
-
|
|
151
|
+
In addition to `ActionDispatch::IntegrationTest`, allow using
|
|
152
|
+
`parsed_body` in `ActionController::TestCase`:
|
|
207
153
|
|
|
208
|
-
|
|
154
|
+
```
|
|
155
|
+
class SomeControllerTest < ActionController::TestCase
|
|
156
|
+
def test_some_action
|
|
157
|
+
post :action, body: { foo: 'bar' }
|
|
158
|
+
assert_equal({ "foo" => "bar" }, response.parsed_body)
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
```
|
|
209
162
|
|
|
210
|
-
Fixes #
|
|
163
|
+
Fixes #34676.
|
|
211
164
|
|
|
212
|
-
*
|
|
165
|
+
*Tobias Bühlmann*
|
|
213
166
|
|
|
214
|
-
*
|
|
167
|
+
* Raise an error on root route naming conflicts.
|
|
215
168
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
about the Content-Security-Policy header see MDN:
|
|
169
|
+
Raises an `ArgumentError` when multiple root routes are defined in the
|
|
170
|
+
same context instead of assigning nil names to subsequent roots.
|
|
219
171
|
|
|
220
|
-
|
|
172
|
+
*Gannon McGibbon*
|
|
221
173
|
|
|
222
|
-
|
|
174
|
+
* Allow rescue from parameter parse errors:
|
|
223
175
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
p.object_src :none
|
|
230
|
-
p.script_src :self, :https
|
|
231
|
-
p.style_src :self, :https, :unsafe_inline
|
|
232
|
-
end
|
|
176
|
+
```
|
|
177
|
+
rescue_from ActionDispatch::Http::Parameters::ParseError do
|
|
178
|
+
head :unauthorized
|
|
179
|
+
end
|
|
180
|
+
```
|
|
233
181
|
|
|
234
|
-
|
|
182
|
+
*Gannon McGibbon*, *Josh Cheek*
|
|
235
183
|
|
|
236
|
-
|
|
237
|
-
class PostsController < ApplicationController
|
|
238
|
-
content_security_policy do |p|
|
|
239
|
-
p.upgrade_insecure_requests true
|
|
240
|
-
end
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
# Using literal values
|
|
244
|
-
class PostsController < ApplicationController
|
|
245
|
-
content_security_policy do |p|
|
|
246
|
-
p.base_uri "https://www.example.com"
|
|
247
|
-
end
|
|
248
|
-
end
|
|
184
|
+
* Reset Capybara sessions if failed system test screenshot raising an exception.
|
|
249
185
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
content_security_policy do |p|
|
|
253
|
-
p.base_uri :self, -> { "https://#{current_user.domain}.example.com" }
|
|
254
|
-
end
|
|
255
|
-
end
|
|
186
|
+
Reset Capybara sessions if `take_failed_screenshot` raise exception
|
|
187
|
+
in system test `after_teardown`.
|
|
256
188
|
|
|
257
|
-
|
|
258
|
-
legacy content using the `content_security_policy_report_only`
|
|
259
|
-
configuration attribute, e.g;
|
|
189
|
+
*Maxim Perepelitsa*
|
|
260
190
|
|
|
261
|
-
|
|
262
|
-
Rails.application.config.content_security_policy_report_only = true
|
|
191
|
+
* Use request object for context if there's no controller
|
|
263
192
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
end
|
|
193
|
+
There is no controller instance when using a redirect route or a
|
|
194
|
+
mounted rack application so pass the request object as the context
|
|
195
|
+
when resolving dynamic CSP sources in this scenario.
|
|
268
196
|
|
|
269
|
-
|
|
270
|
-
reasons since the header is calculated at runtime.
|
|
197
|
+
Fixes #34200.
|
|
271
198
|
|
|
272
199
|
*Andrew White*
|
|
273
200
|
|
|
274
|
-
*
|
|
275
|
-
|
|
276
|
-
*Yuichiro Kaneko*
|
|
277
|
-
|
|
278
|
-
* Remove deprecated `ActionController::ParamsParser::ParseError`.
|
|
201
|
+
* Apply mapping to symbols returned from dynamic CSP sources
|
|
279
202
|
|
|
280
|
-
|
|
203
|
+
Previously if a dynamic source returned a symbol such as :self it
|
|
204
|
+
would be converted to a string implicitly, e.g:
|
|
281
205
|
|
|
282
|
-
|
|
206
|
+
policy.default_src -> { :self }
|
|
283
207
|
|
|
284
|
-
|
|
285
|
-
different host. `allow_other_host` is `true` by default.
|
|
208
|
+
would generate the header:
|
|
286
209
|
|
|
287
|
-
|
|
210
|
+
Content-Security-Policy: default-src self
|
|
288
211
|
|
|
289
|
-
|
|
212
|
+
and now it generates:
|
|
290
213
|
|
|
291
|
-
|
|
214
|
+
Content-Security-Policy: default-src 'self'
|
|
292
215
|
|
|
293
|
-
*
|
|
216
|
+
*Andrew White*
|
|
294
217
|
|
|
295
|
-
|
|
218
|
+
* Add `ActionController::Parameters#each_value`.
|
|
296
219
|
|
|
297
|
-
|
|
220
|
+
*Lukáš Zapletal*
|
|
298
221
|
|
|
299
|
-
|
|
222
|
+
* Deprecate `ActionDispatch::Http::ParameterFilter` in favor of `ActiveSupport::ParameterFilter`.
|
|
300
223
|
|
|
301
|
-
*
|
|
224
|
+
*Yoshiyuki Kinjo*
|
|
302
225
|
|
|
303
|
-
|
|
304
|
-
`
|
|
305
|
-
|
|
306
|
-
|
|
226
|
+
* Encode Content-Disposition filenames on `send_data` and `send_file`.
|
|
227
|
+
Previously, `send_data 'data', filename: "\u{3042}.txt"` sends
|
|
228
|
+
`"filename=\"\u{3042}.txt\""` as Content-Disposition and it can be
|
|
229
|
+
garbled.
|
|
230
|
+
Now it follows [RFC 2231](https://tools.ietf.org/html/rfc2231) and
|
|
231
|
+
[RFC 5987](https://tools.ietf.org/html/rfc5987) and sends
|
|
232
|
+
`"filename=\"%3F.txt\"; filename*=UTF-8''%E3%81%82.txt"`.
|
|
233
|
+
Most browsers can find filename correctly and old browsers fallback to ASCII
|
|
234
|
+
converted name.
|
|
307
235
|
|
|
308
|
-
*
|
|
236
|
+
*Fumiaki Matsushima*
|
|
309
237
|
|
|
310
|
-
*
|
|
238
|
+
* Expose `ActionController::Parameters#each_key` which allows iterating over
|
|
239
|
+
keys without allocating an array.
|
|
311
240
|
|
|
312
|
-
|
|
313
|
-
connection sharing and open request detection work correctly by default.
|
|
241
|
+
*Richard Schneeman*
|
|
314
242
|
|
|
315
|
-
|
|
243
|
+
* Purpose metadata for signed/encrypted cookies.
|
|
316
244
|
|
|
317
|
-
|
|
245
|
+
Rails can now thwart attacks that attempt to copy signed/encrypted value
|
|
246
|
+
of a cookie and use it as the value of another cookie.
|
|
318
247
|
|
|
319
|
-
|
|
320
|
-
|
|
248
|
+
It does so by stashing the cookie-name in the purpose field which is
|
|
249
|
+
then signed/encrypted along with the cookie value. Then, on a server-side
|
|
250
|
+
read, we verify the cookie-names and discard any attacked cookies.
|
|
321
251
|
|
|
322
|
-
|
|
252
|
+
Enable `action_dispatch.use_cookies_with_metadata` to use this feature, which
|
|
253
|
+
writes cookies with the new purpose and expiry metadata embedded.
|
|
323
254
|
|
|
324
255
|
*Assain Jaleel*
|
|
325
256
|
|
|
326
|
-
*
|
|
327
|
-
|
|
328
|
-
Rails can thwart attacks by malicious clients that don't honor a cookie's expiry.
|
|
329
|
-
|
|
330
|
-
It does so by stashing the expiry within the written cookie and relying on the
|
|
331
|
-
signing/encrypting to vouch that it hasn't been tampered with. Then on a
|
|
332
|
-
server-side read, the expiry is verified and any expired cookie is discarded.
|
|
257
|
+
* Raises `ActionController::RespondToMismatchError` with conflicting `respond_to` invocations.
|
|
333
258
|
|
|
334
|
-
|
|
259
|
+
`respond_to` can match multiple types and lead to undefined behavior when
|
|
260
|
+
multiple invocations are made and the types do not match:
|
|
335
261
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
262
|
+
respond_to do |outer_type|
|
|
263
|
+
outer_type.js do
|
|
264
|
+
respond_to do |inner_type|
|
|
265
|
+
inner_type.html { render body: "HTML" }
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
339
269
|
|
|
340
|
-
|
|
270
|
+
*Patrick Toomey*
|
|
341
271
|
|
|
342
|
-
|
|
272
|
+
* `ActionDispatch::Http::UploadedFile` now delegates `to_path` to its tempfile.
|
|
343
273
|
|
|
344
|
-
|
|
274
|
+
This allows uploaded file objects to be passed directly to `File.read`
|
|
275
|
+
without raising a `TypeError`:
|
|
345
276
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
use the response helpers provided by `Rack::Response`.
|
|
277
|
+
uploaded_file = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file)
|
|
278
|
+
File.read(uploaded_file)
|
|
349
279
|
|
|
350
|
-
*
|
|
280
|
+
*Aaron Kromer*
|
|
351
281
|
|
|
352
|
-
*
|
|
282
|
+
* Pass along arguments to underlying `get` method in `follow_redirect!`
|
|
353
283
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
defaults to false to support older versions which have removed it from their
|
|
358
|
-
`ApplicationController`, but is set to true for Rails 5.2.
|
|
284
|
+
Now all arguments passed to `follow_redirect!` are passed to the underlying
|
|
285
|
+
`get` method. This for example allows to set custom headers for the
|
|
286
|
+
redirection request to the server.
|
|
359
287
|
|
|
360
|
-
|
|
288
|
+
follow_redirect!(params: { foo: :bar })
|
|
361
289
|
|
|
362
|
-
*
|
|
290
|
+
*Remo Fritzsche*
|
|
363
291
|
|
|
364
|
-
|
|
292
|
+
* Introduce a new error page to when the implicit render page is accessed in the browser.
|
|
365
293
|
|
|
366
|
-
|
|
294
|
+
Now instead of showing an error page that with exception and backtraces we now show only
|
|
295
|
+
one informative page.
|
|
367
296
|
|
|
368
|
-
|
|
369
|
-
`driven_by` will register the driver and set additional options passed via
|
|
370
|
-
the `:options` parameter.
|
|
297
|
+
*Vinicius Stock*
|
|
371
298
|
|
|
372
|
-
|
|
299
|
+
* Introduce `ActionDispatch::DebugExceptions.register_interceptor`.
|
|
373
300
|
|
|
374
|
-
|
|
301
|
+
Exception aware plugin authors can use the newly introduced
|
|
302
|
+
`.register_interceptor` method to get the processed exception, instead of
|
|
303
|
+
monkey patching DebugExceptions.
|
|
375
304
|
|
|
376
|
-
|
|
305
|
+
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
|
306
|
+
HypoteticalPlugin.capture_exception(request, exception)
|
|
307
|
+
end
|
|
377
308
|
|
|
378
|
-
|
|
379
|
-
encryption in one faster step and produces shorter ciphertexts. Cookies
|
|
380
|
-
encrypted using AES in CBC HMAC mode will be seamlessly upgraded when
|
|
381
|
-
this new mode is enabled via the
|
|
382
|
-
`action_dispatch.use_authenticated_cookie_encryption` configuration value.
|
|
309
|
+
*Genadi Samokovarov*
|
|
383
310
|
|
|
384
|
-
|
|
311
|
+
* Output only one Content-Security-Policy nonce header value per request.
|
|
385
312
|
|
|
386
|
-
|
|
313
|
+
Fixes #32597.
|
|
387
314
|
|
|
388
|
-
|
|
389
|
-
^template path ^template tree digest ^class ^id
|
|
315
|
+
*Andrey Novikov*, *Andrew White*
|
|
390
316
|
|
|
391
|
-
|
|
317
|
+
* Move default headers configuration into their own module that can be included in controllers.
|
|
392
318
|
|
|
393
|
-
*
|
|
394
|
-
`ActiveSupport::Cache` stores and relies on the fact that Active Record has split `#cache_key` and `#cache_version`
|
|
395
|
-
to support it.
|
|
319
|
+
*Kevin Deisz*
|
|
396
320
|
|
|
397
|
-
|
|
321
|
+
* Add method `dig` to `session`.
|
|
398
322
|
|
|
399
|
-
*
|
|
323
|
+
*claudiob*, *Takumi Shotoku*
|
|
400
324
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
may not exist in a certain implementation.
|
|
325
|
+
* Controller level `force_ssl` has been deprecated in favor of
|
|
326
|
+
`config.force_ssl`.
|
|
404
327
|
|
|
405
|
-
|
|
328
|
+
*Derek Prior*
|
|
406
329
|
|
|
407
|
-
|
|
330
|
+
* Rails 6 requires Ruby 2.5.0 or newer.
|
|
408
331
|
|
|
409
|
-
*
|
|
332
|
+
*Jeremy Daer*, *Kasper Timm Hansen*
|
|
410
333
|
|
|
411
334
|
|
|
412
|
-
Please check [5-
|
|
335
|
+
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/actionpack/CHANGELOG.md) for previous changes.
|