actionpack 4.2.11.1 → 5.2.4.6

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.

Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +300 -476
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +6 -7
  5. data/lib/abstract_controller/asset_paths.rb +2 -0
  6. data/lib/abstract_controller/base.rb +45 -49
  7. data/lib/{action_controller → abstract_controller}/caching/fragments.rb +78 -15
  8. data/lib/abstract_controller/caching.rb +66 -0
  9. data/lib/abstract_controller/callbacks.rb +47 -31
  10. data/lib/abstract_controller/collector.rb +8 -11
  11. data/lib/abstract_controller/error.rb +6 -0
  12. data/lib/abstract_controller/helpers.rb +25 -25
  13. data/lib/abstract_controller/logger.rb +2 -0
  14. data/lib/abstract_controller/railties/routes_helpers.rb +4 -2
  15. data/lib/abstract_controller/rendering.rb +42 -41
  16. data/lib/abstract_controller/translation.rb +10 -7
  17. data/lib/abstract_controller/url_for.rb +2 -0
  18. data/lib/abstract_controller.rb +12 -5
  19. data/lib/action_controller/api/api_rendering.rb +16 -0
  20. data/lib/action_controller/api.rb +149 -0
  21. data/lib/action_controller/base.rb +27 -19
  22. data/lib/action_controller/caching.rb +14 -57
  23. data/lib/action_controller/form_builder.rb +50 -0
  24. data/lib/action_controller/log_subscriber.rb +10 -15
  25. data/lib/action_controller/metal/basic_implicit_render.rb +13 -0
  26. data/lib/action_controller/metal/conditional_get.rb +118 -44
  27. data/lib/action_controller/metal/content_security_policy.rb +52 -0
  28. data/lib/action_controller/metal/cookies.rb +3 -3
  29. data/lib/action_controller/metal/data_streaming.rb +27 -46
  30. data/lib/action_controller/metal/etag_with_flash.rb +18 -0
  31. data/lib/action_controller/metal/etag_with_template_digest.rb +20 -13
  32. data/lib/action_controller/metal/exceptions.rb +8 -14
  33. data/lib/action_controller/metal/flash.rb +4 -3
  34. data/lib/action_controller/metal/force_ssl.rb +23 -21
  35. data/lib/action_controller/metal/head.rb +21 -19
  36. data/lib/action_controller/metal/helpers.rb +24 -14
  37. data/lib/action_controller/metal/http_authentication.rb +65 -58
  38. data/lib/action_controller/metal/implicit_render.rb +62 -8
  39. data/lib/action_controller/metal/instrumentation.rb +19 -21
  40. data/lib/action_controller/metal/live.rb +90 -106
  41. data/lib/action_controller/metal/mime_responds.rb +33 -46
  42. data/lib/action_controller/metal/parameter_encoding.rb +51 -0
  43. data/lib/action_controller/metal/params_wrapper.rb +61 -53
  44. data/lib/action_controller/metal/redirecting.rb +49 -28
  45. data/lib/action_controller/metal/renderers.rb +87 -44
  46. data/lib/action_controller/metal/rendering.rb +72 -50
  47. data/lib/action_controller/metal/request_forgery_protection.rb +229 -93
  48. data/lib/action_controller/metal/rescue.rb +9 -16
  49. data/lib/action_controller/metal/streaming.rb +12 -10
  50. data/lib/action_controller/metal/strong_parameters.rb +583 -164
  51. data/lib/action_controller/metal/testing.rb +2 -17
  52. data/lib/action_controller/metal/url_for.rb +19 -10
  53. data/lib/action_controller/metal.rb +98 -83
  54. data/lib/action_controller/railtie.rb +28 -10
  55. data/lib/action_controller/railties/helpers.rb +2 -0
  56. data/lib/action_controller/renderer.rb +117 -0
  57. data/lib/action_controller/template_assertions.rb +11 -0
  58. data/lib/action_controller/test_case.rb +280 -411
  59. data/lib/action_controller.rb +29 -21
  60. data/lib/action_dispatch/http/cache.rb +93 -47
  61. data/lib/action_dispatch/http/content_security_policy.rb +272 -0
  62. data/lib/action_dispatch/http/filter_parameters.rb +26 -20
  63. data/lib/action_dispatch/http/filter_redirect.rb +10 -11
  64. data/lib/action_dispatch/http/headers.rb +55 -22
  65. data/lib/action_dispatch/http/mime_negotiation.rb +56 -41
  66. data/lib/action_dispatch/http/mime_type.rb +134 -121
  67. data/lib/action_dispatch/http/mime_types.rb +20 -6
  68. data/lib/action_dispatch/http/parameter_filter.rb +25 -11
  69. data/lib/action_dispatch/http/parameters.rb +98 -39
  70. data/lib/action_dispatch/http/rack_cache.rb +2 -0
  71. data/lib/action_dispatch/http/request.rb +200 -118
  72. data/lib/action_dispatch/http/response.rb +225 -110
  73. data/lib/action_dispatch/http/upload.rb +12 -6
  74. data/lib/action_dispatch/http/url.rb +110 -28
  75. data/lib/action_dispatch/journey/formatter.rb +55 -32
  76. data/lib/action_dispatch/journey/gtg/builder.rb +7 -5
  77. data/lib/action_dispatch/journey/gtg/simulator.rb +3 -9
  78. data/lib/action_dispatch/journey/gtg/transition_table.rb +17 -16
  79. data/lib/action_dispatch/journey/nfa/builder.rb +5 -3
  80. data/lib/action_dispatch/journey/nfa/dot.rb +13 -13
  81. data/lib/action_dispatch/journey/nfa/simulator.rb +3 -1
  82. data/lib/action_dispatch/journey/nfa/transition_table.rb +5 -48
  83. data/lib/action_dispatch/journey/nodes/node.rb +18 -6
  84. data/lib/action_dispatch/journey/parser.rb +23 -22
  85. data/lib/action_dispatch/journey/parser.y +3 -2
  86. data/lib/action_dispatch/journey/parser_extras.rb +12 -4
  87. data/lib/action_dispatch/journey/path/pattern.rb +50 -44
  88. data/lib/action_dispatch/journey/route.rb +106 -28
  89. data/lib/action_dispatch/journey/router/utils.rb +20 -11
  90. data/lib/action_dispatch/journey/router.rb +35 -23
  91. data/lib/action_dispatch/journey/routes.rb +18 -16
  92. data/lib/action_dispatch/journey/scanner.rb +18 -15
  93. data/lib/action_dispatch/journey/visitors.rb +99 -52
  94. data/lib/action_dispatch/journey.rb +7 -5
  95. data/lib/action_dispatch/middleware/callbacks.rb +1 -2
  96. data/lib/action_dispatch/middleware/cookies.rb +304 -193
  97. data/lib/action_dispatch/middleware/debug_exceptions.rb +152 -57
  98. data/lib/action_dispatch/middleware/debug_locks.rb +124 -0
  99. data/lib/action_dispatch/middleware/exception_wrapper.rb +68 -69
  100. data/lib/action_dispatch/middleware/executor.rb +21 -0
  101. data/lib/action_dispatch/middleware/flash.rb +78 -54
  102. data/lib/action_dispatch/middleware/public_exceptions.rb +27 -25
  103. data/lib/action_dispatch/middleware/reloader.rb +5 -91
  104. data/lib/action_dispatch/middleware/remote_ip.rb +41 -31
  105. data/lib/action_dispatch/middleware/request_id.rb +17 -9
  106. data/lib/action_dispatch/middleware/session/abstract_store.rb +41 -25
  107. data/lib/action_dispatch/middleware/session/cache_store.rb +24 -14
  108. data/lib/action_dispatch/middleware/session/cookie_store.rb +72 -67
  109. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +8 -2
  110. data/lib/action_dispatch/middleware/show_exceptions.rb +26 -22
  111. data/lib/action_dispatch/middleware/ssl.rb +114 -36
  112. data/lib/action_dispatch/middleware/stack.rb +31 -44
  113. data/lib/action_dispatch/middleware/static.rb +57 -50
  114. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +2 -14
  115. data/lib/action_dispatch/middleware/templates/rescues/{_source.erb → _source.html.erb} +0 -0
  116. data/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
  117. data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +21 -0
  118. data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +13 -0
  119. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +1 -0
  120. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +1 -1
  121. data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +1 -1
  122. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +4 -4
  123. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +64 -64
  124. data/lib/action_dispatch/railtie.rb +19 -11
  125. data/lib/action_dispatch/request/session.rb +106 -59
  126. data/lib/action_dispatch/request/utils.rb +67 -24
  127. data/lib/action_dispatch/routing/endpoint.rb +9 -2
  128. data/lib/action_dispatch/routing/inspector.rb +58 -67
  129. data/lib/action_dispatch/routing/mapper.rb +733 -447
  130. data/lib/action_dispatch/routing/polymorphic_routes.rb +166 -140
  131. data/lib/action_dispatch/routing/redirection.rb +36 -26
  132. data/lib/action_dispatch/routing/route_set.rb +321 -291
  133. data/lib/action_dispatch/routing/routes_proxy.rb +32 -5
  134. data/lib/action_dispatch/routing/url_for.rb +65 -25
  135. data/lib/action_dispatch/routing.rb +17 -18
  136. data/lib/action_dispatch/system_test_case.rb +147 -0
  137. data/lib/action_dispatch/system_testing/browser.rb +49 -0
  138. data/lib/action_dispatch/system_testing/driver.rb +59 -0
  139. data/lib/action_dispatch/system_testing/server.rb +31 -0
  140. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +96 -0
  141. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +31 -0
  142. data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +26 -0
  143. data/lib/action_dispatch/testing/assertion_response.rb +47 -0
  144. data/lib/action_dispatch/testing/assertions/response.rb +45 -20
  145. data/lib/action_dispatch/testing/assertions/routing.rb +30 -26
  146. data/lib/action_dispatch/testing/assertions.rb +6 -4
  147. data/lib/action_dispatch/testing/integration.rb +347 -209
  148. data/lib/action_dispatch/testing/request_encoder.rb +55 -0
  149. data/lib/action_dispatch/testing/test_process.rb +28 -22
  150. data/lib/action_dispatch/testing/test_request.rb +27 -34
  151. data/lib/action_dispatch/testing/test_response.rb +35 -7
  152. data/lib/action_dispatch.rb +27 -19
  153. data/lib/action_pack/gem_version.rb +5 -3
  154. data/lib/action_pack/version.rb +3 -1
  155. data/lib/action_pack.rb +4 -2
  156. metadata +59 -41
  157. data/lib/action_controller/metal/hide_actions.rb +0 -40
  158. data/lib/action_controller/metal/rack_delegation.rb +0 -32
  159. data/lib/action_controller/middleware.rb +0 -39
  160. data/lib/action_controller/model_naming.rb +0 -12
  161. data/lib/action_dispatch/journey/backwards.rb +0 -5
  162. data/lib/action_dispatch/journey/router/strexp.rb +0 -27
  163. data/lib/action_dispatch/middleware/params_parser.rb +0 -60
  164. data/lib/action_dispatch/testing/assertions/dom.rb +0 -3
  165. data/lib/action_dispatch/testing/assertions/selector.rb +0 -3
  166. data/lib/action_dispatch/testing/assertions/tag.rb +0 -3
data/CHANGELOG.md CHANGED
@@ -1,680 +1,504 @@
1
- ## Rails 4.2.11.1 (March 11, 2019) ##
2
-
3
- * No changes.
4
-
5
-
6
- ## Rails 4.2.11 (November 27, 2018) ##
7
-
8
- * No changes.
1
+ ## Rails 5.2.4.6 (May 05, 2021) ##
9
2
 
3
+ * Prevent regex DoS in HTTP token authentication
4
+ CVE-2021-22904
10
5
 
11
- ## Rails 4.2.10 (September 27, 2017) ##
6
+ * Prevent string polymorphic route arguments.
12
7
 
13
- * Fix regression in behavior of `normalize_path`.
8
+ `url_for` supports building polymorphic URLs via an array
9
+ of arguments (usually symbols and records). If a developer passes a
10
+ user input array, strings can result in unwanted route helper calls.
14
11
 
15
- In Rails 5 there was a change to ensure the encoding of the original string
16
- in a path was maintained. This was incorrectly backported to Rails 4.2 which
17
- caused a regression.
12
+ CVE-2021-22885
18
13
 
19
- *Eileen M. Uchitelle*
20
-
21
- ## Rails 4.2.9 (June 26, 2017) ##
22
-
23
- * Use more specific check for :format in route path
24
-
25
- The current check for whether to add an optional format to the path is very lax
26
- and will match things like `:format_id` where there are nested resources, e.g:
27
-
28
- ``` ruby
29
- resources :formats do
30
- resources :items
31
- end
32
- ```
14
+ *Gannon McGibbon*
33
15
 
34
- Fix this by using a more restrictive regex pattern that looks for the patterns
35
- `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
36
- allow for multiple closing parenthesis since the route may be of this form:
37
-
38
- ``` ruby
39
- get "/books(/:action(.:format))", controller: "books"
40
- ```
41
-
42
- This probably isn't what's intended since it means that the default index action
43
- route doesn't support a format but we have a test for it so we need to allow it.
44
-
45
- Fixes #28517.
46
-
47
- *Andrew White*
48
-
49
-
50
- ## Rails 4.2.8 (February 21, 2017) ##
16
+ ## Rails 5.2.4.5 (February 10, 2021) ##
51
17
 
52
18
  * No changes.
53
19
 
54
20
 
55
- ## Rails 4.2.7 (July 12, 2016) ##
21
+ ## Rails 5.2.4.4 (September 09, 2020) ##
56
22
 
57
23
  * No changes.
58
24
 
59
25
 
60
- ## Rails 4.2.6 (March 07, 2016) ##
61
-
62
- * No changes.
63
-
26
+ ## Rails 5.2.4.3 (May 18, 2020) ##
64
27
 
65
- ## Rails 4.2.5.2 (February 26, 2016) ##
28
+ * [CVE-2020-8166] HMAC raw CSRF token before masking it, so it cannot be used to reconstruct a per-form token
66
29
 
67
- * Do not allow render with unpermitted parameter.
30
+ * [CVE-2020-8164] Return self when calling #each, #each_pair, and #each_value instead of the raw @parameters hash
68
31
 
69
- Fixes CVE-2016-2098.
70
32
 
71
- *Arthur Neves*
33
+ ## Rails 5.2.4.1 (December 18, 2019) ##
72
34
 
35
+ * Fix possible information leak / session hijacking vulnerability.
73
36
 
74
- ## Rails 4.2.5.1 (January 25, 2015) ##
37
+ The `ActionDispatch::Session::MemcacheStore` is still vulnerable given it requires the
38
+ gem dalli to be updated as well.
75
39
 
76
- * No changes.
40
+ CVE-2019-16782.
77
41
 
78
42
 
79
- ## Rails 4.2.5 (November 12, 2015) ##
43
+ ## Rails 5.2.4 (November 27, 2019) ##
80
44
 
81
- * `ActionController::TestCase` can teardown gracefully if an error is raised
82
- early in the `setup` chain.
45
+ * No changes.
83
46
 
84
- *Yves Senn*
85
47
 
86
- * Parse RSS/ATOM responses as XML, not HTML.
48
+ ## Rails 5.2.3 (March 27, 2019) ##
87
49
 
88
- *Alexander Kaupanin*
50
+ * Allow using `public` and `no-cache` together in the the Cache Control header.
89
51
 
90
- * Fix regression in mounted engine named routes generation for app deployed to
91
- a subdirectory. `relative_url_root` was prepended to the path twice (e.g.
92
- "/subdir/subdir/engine_path" instead of "/subdir/engine_path")
52
+ Before this change, even if `public` was specified in the Cache Control header,
53
+ it was excluded when `no-cache` was included. This change preserves the
54
+ `public` value as is.
93
55
 
94
- Fixes #20920. Fixes #21459.
56
+ Fixes #34780.
95
57
 
96
- *Matthew Erhard*
58
+ *Yuji Yaginuma*
97
59
 
98
- * `url_for` does not modify its arguments when generating polymorphic URLs.
60
+ * Allow `nil` params for `ActionController::TestCase`.
99
61
 
100
- *Bernerd Schaefer*
62
+ *Ryo Nakamura*
101
63
 
102
- * Update `ActionController::TestSession#fetch` to behave more like
103
- `ActionDispatch::Request::Session#fetch` when using non-string keys.
104
64
 
105
- *Jeremy Friesen*
65
+ ## Rails 5.2.2.1 (March 11, 2019) ##
106
66
 
67
+ * No changes.
107
68
 
108
- ## Rails 4.2.4 (August 24, 2015) ##
109
69
 
110
- * ActionController::TestSession now accepts a default value as well as
111
- a block for generating a default value based off the key provided.
70
+ ## Rails 5.2.2 (December 04, 2018) ##
112
71
 
113
- This fixes calls to session#fetch in ApplicationController instances that
114
- take more two arguments or a block from raising `ArgumentError: wrong
115
- number of arguments (2 for 1)` when performing controller tests.
72
+ * Reset Capybara sessions if failed system test screenshot raising an exception.
116
73
 
117
- *Matthew Gerrior*
74
+ Reset Capybara sessions if `take_failed_screenshot` raise exception
75
+ in system test `after_teardown`.
118
76
 
119
- * Fix to keep original header instance in `ActionDispatch::SSL`
77
+ *Maxim Perepelitsa*
120
78
 
121
- `ActionDispatch::SSL` changes headers to `Hash`.
122
- So some headers will be broken if there are some middlewares
123
- on `ActionDispatch::SSL` and if it uses `Rack::Utils::HeaderHash`.
79
+ * Use request object for context if there's no controller
124
80
 
125
- *Fumiaki Matsushima*
81
+ There is no controller instance when using a redirect route or a
82
+ mounted rack application so pass the request object as the context
83
+ when resolving dynamic CSP sources in this scenario.
126
84
 
85
+ Fixes #34200.
127
86
 
128
- ## Rails 4.2.3 (June 25, 2015) ##
87
+ *Andrew White*
129
88
 
130
- * Fix rake routes not showing the right format when
131
- nesting multiple routes.
89
+ * Apply mapping to symbols returned from dynamic CSP sources
132
90
 
133
- See #18373.
91
+ Previously if a dynamic source returned a symbol such as :self it
92
+ would be converted to a string implicity, e.g:
134
93
 
135
- *Ravil Bayramgalin*
94
+ policy.default_src -> { :self }
136
95
 
137
- * Fix regression where a gzip file response would have a Content-type,
138
- even when it was a 304 status code.
96
+ would generate the header:
139
97
 
140
- See #19271.
98
+ Content-Security-Policy: default-src self
141
99
 
142
- *Kohei Suzuki*
100
+ and now it generates:
143
101
 
144
- * Fix handling of empty X_FORWARDED_HOST header in raw_host_with_port
102
+ Content-Security-Policy: default-src 'self'
145
103
 
146
- Previously, an empty X_FORWARDED_HOST header would cause
147
- Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
148
- Actiondispatch::Http:URL.host to raise a NoMethodError.
104
+ *Andrew White*
149
105
 
150
- *Adam Forsyth*
106
+ * Fix `rails routes -c` for controller name consists of multiple word.
151
107
 
152
- * Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
108
+ *Yoshiyuki Kinjo*
153
109
 
154
- Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not
155
- prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack)
156
- is set, it takes precedence.
110
+ * Call the `#redirect_to` block in controller context.
157
111
 
158
- Fixes #5122.
112
+ *Steven Peckins*
159
113
 
160
- *Yasyf Mohamedali*
161
114
 
162
- * Fix regression in functional tests. Responses should have default headers
163
- assigned.
115
+ ## Rails 5.2.1.1 (November 27, 2018) ##
164
116
 
165
- See #18423.
117
+ * No changes.
166
118
 
167
- *Jeremy Kemper*, *Yves Senn*
168
119
 
120
+ ## Rails 5.2.1 (August 07, 2018) ##
169
121
 
170
- ## Rails 4.2.2 (June 16, 2015) ##
122
+ * Prevent `?null=` being passed on JSON encoded test requests.
171
123
 
172
- * No Changes *
124
+ `RequestEncoder#encode_params` won't attempt to parse params if
125
+ there are none.
173
126
 
127
+ So call like this will no longer append a `?null=` query param.
174
128
 
175
- ## Rails 4.2.1 (March 19, 2015) ##
129
+ get foos_url, as: :json
176
130
 
177
- * Non-string authenticity tokens do not raise NoMethodError when decoding
178
- the masked token.
131
+ *Alireza Bashiri*
179
132
 
180
- *Ville Lautanala*
133
+ * Ensure `ActionController::Parameters#transform_values` and
134
+ `ActionController::Parameters#transform_values!` converts hashes into
135
+ parameters.
181
136
 
182
- * Explicitly ignored wildcard verbs when searching for HEAD routes before fallback
137
+ *Kevin Sjöberg*
183
138
 
184
- Fixes an issue where a mounted rack app at root would intercept the HEAD
185
- request causing an incorrect behavior during the fall back to GET requests.
139
+ * Fix strong parameters `permit!` with nested arrays.
186
140
 
187
- Example:
188
- ```ruby
189
- draw do
190
- get '/home' => 'test#index'
191
- mount rack_app, at: '/'
192
- end
193
- head '/home'
194
- assert_response :success
141
+ Given:
142
+ ```
143
+ params = ActionController::Parameters.new(nested_arrays: [[{ x: 2, y: 3 }, { x: 21, y: 42 }]])
144
+ params.permit!
195
145
  ```
196
- In this case, a HEAD request runs through the routes the first time and fails
197
- to match anything. Then, it runs through the list with the fallback and matches
198
- `get '/home'`. The original behavior would match the rack app in the first pass.
199
-
200
- *Terence Sun*
201
-
202
- * Preserve default format when generating URLs
203
-
204
- Fixes an issue that would cause the format set in default_url_options to be
205
- lost when generating URLs with fewer positional arguments than parameters in
206
- the route definition.
207
-
208
- Backport of #18627
209
-
210
- *Tekin Suleyman*, *Dominic Baggott*
211
-
212
- * Default headers, removed in controller actions, are no longer reapplied on
213
- the test response.
214
-
215
- *Jonas Baumann*
216
-
217
- * Ensure `append_info_to_payload` is called even if an exception is raised.
218
-
219
- Fixes an issue where when an exception is raised in the request the additonal
220
- payload data is not available.
221
-
222
- See:
223
- * #14903
224
- * https://github.com/roidrage/lograge/issues/37
225
-
226
- *Dieter Komendera*, *Margus Pärt*
227
-
228
- * Correctly rely on the response's status code to handle calls to `head`.
229
-
230
- *Robin Dupret*
231
-
232
- * Using `head` method returns empty response_body instead
233
- of returning a single space " ".
234
-
235
- The old behavior was added as a workaround for a bug in an early
236
- version of Safari, where the HTTP headers are not returned correctly
237
- if the response body has a 0-length. This is been fixed since and
238
- the workaround is no longer necessary.
239
-
240
- Fixes #18253.
241
-
242
- *Prathamesh Sonpatki*
243
-
244
- * Fix how polymorphic routes works with objects that implement `to_model`.
245
-
246
- *Travis Grathwell*
247
-
248
- * Fixed handling of positional url helper arguments when `format: false`.
249
-
250
- Fixes #17819.
251
-
252
- *Andrew White*, *Tatiana Soukiassian*
253
-
254
- * Fixed usage of optional scopes in URL helpers.
255
-
256
- *Alex Robbin*
257
-
258
-
259
- ## Rails 4.2.0 (December 20, 2014) ##
260
-
261
- * Add `ActionController::Parameters#to_unsafe_h` to return an unfiltered
262
- `Hash` representation of Parameters object. This is now a preferred way to
263
- retrieve unfiltered parameters as we will stop inheriting `AC::Parameters`
264
- object in Rails 5.0.
265
-
266
- *Prem Sichanugrist*
267
-
268
- * Restore handling of a bare `Authorization` header, without `token=`
269
- prefix.
270
-
271
- Fixes #17108.
272
-
273
- *Guo Xiang Tan*
274
-
275
- * Deprecate use of string keys in URL helpers.
276
-
277
- Use symbols instead.
278
- Fixes #16958.
279
-
280
- *Byron Bischoff*, *Melanie Gilman*
281
-
282
- * Deprecate the `only_path` option on `*_path` helpers.
283
-
284
- In cases where this option is set to `true`, the option is redundant and can
285
- be safely removed; otherwise, the corresponding `*_url` helper should be
286
- used instead.
287
-
288
- Fixes #17294.
289
-
290
- *Dan Olson*, *Godfrey Chan*
291
-
292
- * Improve Journey compliance to RFC 3986.
293
-
294
- The scanner in Journey failed to recognize routes that use literals
295
- from the sub-delims section of RFC 3986. It's now able to parse those
296
- authorized delimiters and route as expected.
297
-
298
- Fixes #17212.
299
-
300
- *Nicolas Cavigneaux*
301
-
302
- * Deprecate implicit Array conversion for Response objects. It was added
303
- (using `#to_ary`) so we could conveniently use implicit splatting:
304
-
305
- status, headers, body = response
306
-
307
- But it also means `response + response` works and `[response].flatten`
308
- cascades down to the Rack body. Nonsense behavior. Instead, rely on
309
- explicit conversion and splatting with `#to_a`:
310
-
311
- status, header, body = *response
312
-
313
- *Jeremy Kemper*
314
-
315
- * Don't rescue `IPAddr::InvalidAddressError`.
316
-
317
- `IPAddr::InvalidAddressError` does not exist in Ruby 1.9.3
318
- and fails for JRuby in 1.9 mode.
319
-
320
- *Peter Suschlik*
321
-
322
- * Fix bug where the router would ignore any constraints added to redirect
323
- routes.
324
-
325
- Fixes #16605.
326
-
327
- *Agis Anastasopoulos*
328
146
 
329
- * Allow `config.action_dispatch.trusted_proxies` to accept an IPAddr object.
147
+ `params[:nested_arrays][0][0].permitted?` will now return `true` instead of `false`.
330
148
 
331
- Example:
149
+ *Steve Hull*
332
150
 
333
- # config/environments/production.rb
334
- config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
151
+ * Reset `RAW_POST_DATA` and `CONTENT_LENGTH` request environment between test requests in
152
+ `ActionController::TestCase` subclasses.
335
153
 
336
- *Sam Aarons*
154
+ *Eugene Kenny*
337
155
 
338
- * Avoid duplicating routes for HEAD requests.
156
+ * Output only one Content-Security-Policy nonce header value per request.
339
157
 
340
- Instead of duplicating the routes, we will first match the HEAD request to
341
- HEAD routes. If no match is found, we will then map the HEAD request to
342
- GET routes.
158
+ Fixes #32597.
343
159
 
344
- *Guo Xiang Tan*, *Andrew White*
160
+ *Andrey Novikov*, *Andrew White*
345
161
 
346
- * Requests that hit `ActionDispatch::Static` can now take advantage
347
- of gzipped assets on disk. By default a gzip asset will be served if
348
- the client supports gzip and a compressed file is on disk.
162
+ * Only disable GPUs for headless Chrome on Windows.
349
163
 
350
- *Richard Schneeman*
164
+ It is not necessary anymore for Linux and macOS machines.
351
165
 
352
- * `ActionController::Parameters` will stop inheriting from `Hash` and
353
- `HashWithIndifferentAccess` in the next major release. If you use any method
354
- that is not available on `ActionController::Parameters` you should consider
355
- calling `#to_h` to convert it to a `Hash` first before calling that method.
166
+ https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1
356
167
 
357
- *Prem Sichanugrist*
168
+ *Stefan Wrobel*
358
169
 
359
- * `ActionController::Parameters#to_h` now returns a `Hash` with unpermitted
360
- keys removed. This change is to reflect on a security concern where some
361
- method performed on an `ActionController::Parameters` may yield a `Hash`
362
- object which does not maintain `permitted?` status. If you would like to
363
- get a `Hash` with all the keys intact, duplicate and mark it as permitted
364
- before calling `#to_h`.
170
+ * Fix system tests transactions not closed between examples.
365
171
 
366
- params = ActionController::Parameters.new({
367
- name: 'Senjougahara Hitagi',
368
- oddity: 'Heavy stone crab'
369
- })
370
- params.to_h
371
- # => {}
172
+ *Sergey Tarasov*
372
173
 
373
- unsafe_params = params.dup.permit!
374
- unsafe_params.to_h
375
- # => {"name"=>"Senjougahara Hitagi", "oddity"=>"Heavy stone crab"}
376
174
 
377
- safe_params = params.permit(:name)
378
- safe_params.to_h
379
- # => {"name"=>"Senjougahara Hitagi"}
175
+ ## Rails 5.2.0 (April 09, 2018) ##
380
176
 
381
- This change is consider a stopgap as we cannot change the code to stop
382
- `ActionController::Parameters` to inherit from `HashWithIndifferentAccess`
383
- in the next minor release.
177
+ * Check exclude before flagging cookies as secure.
384
178
 
385
- *Prem Sichanugrist*
179
+ *Catherine Khuu*
386
180
 
387
- * Deprecated `TagAssertions`.
181
+ * Always yield a CSP policy instance from `content_security_policy`
388
182
 
389
- *Kasper Timm Hansen*
183
+ This allows a controller action to enable the policy individually
184
+ for a controller and/or specific actions.
390
185
 
391
- * Use the Active Support JSON encoder for cookie jars using the `:json` or
392
- `:hybrid` serializer. This allows you to serialize custom Ruby objects into
393
- cookies by defining the `#as_json` hook on such objects.
186
+ *Andrew White*
394
187
 
395
- Fixes #16520.
188
+ * Add the ability to disable the global CSP in a controller, e.g:
396
189
 
397
- *Godfrey Chan*
190
+ class LegacyPagesController < ApplicationController
191
+ content_security_policy false, only: :index
192
+ end
398
193
 
399
- * Add `config.action_dispatch.cookies_digest` option for setting custom
400
- digest. The default remains the same - 'SHA1'.
194
+ *Andrew White*
401
195
 
402
- *Łukasz Strzałkowski*
196
+ * Add alias method `to_hash` to `to_h` for `cookies`.
197
+ Add alias method `to_h` to `to_hash` for `session`.
403
198
 
404
- * Move `respond_with` (and the class-level `respond_to`) to
405
- the `responders` gem.
199
+ *Igor Kasyanchuk*
406
200
 
407
- *José Valim*
201
+ * Update the default HSTS max-age value to 31536000 seconds (1 year)
202
+ to meet the minimum max-age requirement for https://hstspreload.org/.
408
203
 
409
- * When your templates change, browser caches bust automatically.
204
+ *Grant Bourque*
410
205
 
411
- New default: the template digest is automatically included in your ETags.
412
- When you call `fresh_when @post`, the digest for `posts/show.html.erb`
413
- is mixed in so future changes to the HTML will blow HTTP caches for you.
414
- This makes it easy to HTTP-cache many more of your actions.
206
+ * Add support for automatic nonce generation for Rails UJS.
415
207
 
416
- If you render a different template, you can now pass the `:template`
417
- option to include its digest instead:
208
+ Because the UJS library creates a script tag to process responses it
209
+ normally requires the script-src attribute of the content security
210
+ policy to include 'unsafe-inline'.
418
211
 
419
- fresh_when @post, template: 'widgets/show'
212
+ To work around this we generate a per-request nonce value that is
213
+ embedded in a meta tag in a similar fashion to how CSRF protection
214
+ embeds its token in a meta tag. The UJS library can then read the
215
+ nonce value and set it on the dynamically generated script tag to
216
+ enable it to execute without needing 'unsafe-inline' enabled.
420
217
 
421
- Pass `template: false` to skip the lookup. To turn this off entirely, set:
218
+ Nonce generation isn't 100% safe - if your script tag is including
219
+ user generated content in someway then it may be possible to exploit
220
+ an XSS vulnerability which can take advantage of the nonce. It is
221
+ however an improvement on a blanket permission for inline scripts.
422
222
 
423
- config.action_controller.etag_with_template_digest = false
223
+ It is also possible to use the nonce within your own script tags by
224
+ using `nonce: true` to set the nonce value on the tag, e.g
424
225
 
425
- *Jeremy Kemper*
226
+ <%= javascript_tag nonce: true do %>
227
+ alert('Hello, World!');
228
+ <% end %>
426
229
 
427
- * Remove deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
428
- in favor of `AbstractController::Helpers::MissingHelperError`.
230
+ Fixes #31689.
429
231
 
430
- *Yves Senn*
232
+ *Andrew White*
431
233
 
432
- * Fix `assert_template` not being able to assert that no files were rendered.
234
+ * Matches behavior of `Hash#each` in `ActionController::Parameters#each`.
433
235
 
434
- *Guo Xiang Tan*
236
+ Rails 5.0 introduced a bug when looping through controller params using `each`. Only the keys of params hash were passed to the block, e.g.
435
237
 
436
- * Extract source code for the entire exception stack trace for
437
- better debugging and diagnosis.
238
+ # Parameters: {"param"=>"1", "param_two"=>"2"}
239
+ def index
240
+ params.each do |name|
241
+ puts name
242
+ end
243
+ end
438
244
 
439
- *Ryan Dao*
245
+ # Prints
246
+ # param
247
+ # param_two
440
248
 
441
- * Allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8
442
- loopback address.
249
+ In Rails 5.2 the bug has been fixed and name will be an array (which was the behavior for all versions prior to 5.0), instead of a string.
443
250
 
444
- *Earl St Sauver*, *Sven Riedel*
251
+ To fix the code above simply change as per example below:
445
252
 
446
- * Preserve original path in `ShowExceptions` middleware by stashing it as
447
- `env["action_dispatch.original_path"]`
253
+ # Parameters: {"param"=>"1", "param_two"=>"2"}
254
+ def index
255
+ params.each do |name, value|
256
+ puts name
257
+ end
258
+ end
448
259
 
449
- `ActionDispatch::ShowExceptions` overwrites `PATH_INFO` with the status code
450
- for the exception defined in `ExceptionWrapper`, so the path
451
- the user was visiting when an exception occurred was not previously
452
- available to any custom exceptions_app. The original `PATH_INFO` is now
453
- stashed in `env["action_dispatch.original_path"]`.
260
+ # Prints
261
+ # param
262
+ # param_two
454
263
 
455
- *Grey Baker*
264
+ *Dominic Cleal*
456
265
 
457
- * Use `String#bytesize` instead of `String#size` when checking for cookie
458
- overflow.
266
+ * Add `Referrer-Policy` header to default headers set.
459
267
 
460
- *Agis Anastasopoulos*
268
+ *Guillermo Iguaran*
461
269
 
462
- * `render nothing: true` or rendering a `nil` body no longer add a single
463
- space to the response body.
270
+ * Changed the system tests to set Puma as default server only when the
271
+ user haven't specified manually another server.
464
272
 
465
- The old behavior was added as a workaround for a bug in an early version of
466
- Safari, where the HTTP headers are not returned correctly if the response
467
- body has a 0-length. This is been fixed since and the workaround is no
468
- longer necessary.
273
+ *Guillermo Iguaran*
469
274
 
470
- Use `render body: ' '` if the old behavior is desired.
275
+ * Add secure `X-Download-Options` and `X-Permitted-Cross-Domain-Policies` to
276
+ default headers set.
471
277
 
472
- See #14883 for details.
278
+ *Guillermo Iguaran*
473
279
 
474
- *Godfrey Chan*
280
+ * Add headless firefox support to System Tests.
475
281
 
476
- * Prepend a JS comment to JSONP callbacks. Addresses CVE-2014-4671
477
- ("Rosetta Flash").
282
+ *bogdanvlviv*
478
283
 
479
- *Greg Campbell*
284
+ * Changed the default system test screenshot output from `inline` to `simple`.
480
285
 
481
- * Because URI paths may contain non US-ASCII characters we need to force
482
- the encoding of any unescaped URIs to UTF-8 if they are US-ASCII.
483
- This essentially replicates the functionality of the monkey patch to
484
- URI.parser.unescape in active_support/core_ext/uri.rb.
286
+ `inline` works well for iTerm2 but not everyone uses iTerm2. Some terminals like
287
+ Terminal.app ignore the `inline` and output the path to the file since it can't
288
+ render the image. Other terminals, like those on Ubuntu, cannot handle the image
289
+ inline, but also don't handle it gracefully and instead of outputting the file
290
+ path, it dumps binary into the terminal.
485
291
 
486
- Fixes #16104.
292
+ Commit 9d6e28 fixes this by changing the default for screenshot to be `simple`.
487
293
 
488
- *Karl Entwistle*
294
+ *Eileen M. Uchitelle*
489
295
 
490
- * Generate shallow paths for all children of shallow resources.
296
+ * Register most popular audio/video/font mime types supported by modern browsers.
491
297
 
492
- Fixes #15783.
298
+ *Guillermo Iguaran*
493
299
 
494
- *Seb Jacobs*
300
+ * Fix optimized url helpers when using relative url root.
495
301
 
496
- * JSONP responses are now rendered with the `text/javascript` content type
497
- when rendering through a `respond_to` block.
302
+ Fixes #31220.
498
303
 
499
- Fixes #15081.
304
+ *Andrew White*
500
305
 
501
- *Lucas Mazza*
306
+ * Add DSL for configuring Content-Security-Policy header.
502
307
 
503
- * Add `config.action_controller.always_permitted_parameters` to configure which
504
- parameters are permitted globally. The default value of this configuration is
505
- `['controller', 'action']`.
308
+ The DSL allows you to configure a global Content-Security-Policy
309
+ header and then override within a controller. For more information
310
+ about the Content-Security-Policy header see MDN:
506
311
 
507
- *Gary S. Weaver*, *Rafael Chacon*
312
+ https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
508
313
 
509
- * Fix env['PATH_INFO'] missing leading slash when a rack app mounted at '/'.
314
+ Example global policy:
510
315
 
511
- Fixes #15511.
316
+ # config/initializers/content_security_policy.rb
317
+ Rails.application.config.content_security_policy do |p|
318
+ p.default_src :self, :https
319
+ p.font_src :self, :https, :data
320
+ p.img_src :self, :https, :data
321
+ p.object_src :none
322
+ p.script_src :self, :https
323
+ p.style_src :self, :https, :unsafe_inline
324
+ end
512
325
 
513
- *Larry Lv*
326
+ Example controller overrides:
514
327
 
515
- * ActionController::Parameters#require now accepts `false` values.
328
+ # Override policy inline
329
+ class PostsController < ApplicationController
330
+ content_security_policy do |p|
331
+ p.upgrade_insecure_requests true
332
+ end
333
+ end
516
334
 
517
- Fixes #15685.
335
+ # Using literal values
336
+ class PostsController < ApplicationController
337
+ content_security_policy do |p|
338
+ p.base_uri "https://www.example.com"
339
+ end
340
+ end
518
341
 
519
- *Sergio Romano*
342
+ # Using mixed static and dynamic values
343
+ class PostsController < ApplicationController
344
+ content_security_policy do |p|
345
+ p.base_uri :self, -> { "https://#{current_user.domain}.example.com" }
346
+ end
347
+ end
520
348
 
521
- * With authorization header `Authorization: Token token=`, `authenticate` now
522
- recognize token as nil, instead of "token".
349
+ Allows you to also only report content violations for migrating
350
+ legacy content using the `content_security_policy_report_only`
351
+ configuration attribute, e.g;
523
352
 
524
- Fixes #14846.
353
+ # config/initializers/content_security_policy.rb
354
+ Rails.application.config.content_security_policy_report_only = true
525
355
 
526
- *Larry Lv*
356
+ # controller override
357
+ class PostsController < ApplicationController
358
+ content_security_policy_report_only only: :index
359
+ end
527
360
 
528
- * Ensure the controller is always notified as soon as the client disconnects
529
- during live streaming, even when the controller is blocked on a write.
361
+ Note that this feature does not validate the header for performance
362
+ reasons since the header is calculated at runtime.
530
363
 
531
- *Nicholas Jakobsen*, *Matthew Draper*
364
+ *Andrew White*
532
365
 
533
- * Routes specifying 'to:' must be a string that contains a "#" or a rack
534
- application. Use of a symbol should be replaced with `action: symbol`.
535
- Use of a string without a "#" should be replaced with `controller: string`.
366
+ * Make `assert_recognizes` to traverse mounted engines.
536
367
 
537
- *Aaron Patterson*
368
+ *Yuichiro Kaneko*
538
369
 
539
- * Fix URL generation with `:trailing_slash` such that it does not add
540
- a trailing slash after `.:format`
370
+ * Remove deprecated `ActionController::ParamsParser::ParseError`.
541
371
 
542
- *Dan Langevin*
372
+ *Rafael Mendonça França*
543
373
 
544
- * Build full URI as string when processing path in integration tests for
545
- performance reasons. One consequence of this is that the leading slash
546
- is now required in integration test `process` helpers, whereas previously
547
- it could be omitted. The fact that this worked was a unintended consequence
548
- of the implementation and was never an intentional feature.
374
+ * Add `:allow_other_host` option to `redirect_back` method.
549
375
 
550
- *Guo Xiang Tan*
376
+ When `allow_other_host` is set to `false`, the `redirect_back` will not allow redirecting from a
377
+ different host. `allow_other_host` is `true` by default.
551
378
 
552
- * Fix `'Stack level too deep'` when rendering `head :ok` in an action method
553
- called 'status' in a controller.
379
+ *Tim Masliuchenko*
554
380
 
555
- Fixes #13905.
381
+ * Add headless chrome support to System Tests.
556
382
 
557
- *Christiaan Van den Poel*
383
+ *Yuji Yaginuma*
558
384
 
559
- * Add MKCALENDAR HTTP method (RFC 4791).
385
+ * Add ability to enable Early Hints for HTTP/2
560
386
 
561
- *Sergey Karpesh*
387
+ If supported by the server, and enabled in Puma this allows H2 Early Hints to be used.
562
388
 
563
- * Instrument fragment cache metrics.
389
+ The `javascript_include_tag` and the `stylesheet_link_tag` automatically add Early Hints if requested.
564
390
 
565
- Adds `:controller`: and `:action` keys to the instrumentation payload
566
- for the `*_fragment.action_controller` notifications. This allows tracking
567
- e.g. the fragment cache hit rates for each controller action.
391
+ *Eileen M. Uchitelle*, *Aaron Patterson*
568
392
 
569
- *Daniel Schierbeck*
393
+ * Simplify cookies middleware with key rotation support
570
394
 
571
- * Always use the provided port if the protocol is relative.
395
+ Use the `rotate` method for both `MessageEncryptor` and
396
+ `MessageVerifier` to add key rotation support for encrypted and
397
+ signed cookies. This also helps simplify support for legacy cookie
398
+ security.
572
399
 
573
- Fixes #15043.
400
+ *Michael J Coyne*
574
401
 
575
- *Guilherme Cavalcanti*, *Andrew White*
402
+ * Use Capybara registered `:puma` server config.
576
403
 
577
- * Moved `params[request_forgery_protection_token]` into its own method
578
- and improved tests.
404
+ The Capybara registered `:puma` server ensures the puma server is run in process so
405
+ connection sharing and open request detection work correctly by default.
579
406
 
580
- Fixes #11316.
407
+ *Thomas Walpole*
581
408
 
582
- *Tom Kadwill*
409
+ * Cookies `:expires` option supports `ActiveSupport::Duration` object.
583
410
 
584
- * Added verification of route constraints given as a Proc or an object responding
585
- to `:matches?`. Previously, when given an non-complying object, it would just
586
- silently fail to enforce the constraint. It will now raise an `ArgumentError`
587
- when setting up the routes.
411
+ cookies[:user_name] = { value: "assain", expires: 1.hour }
412
+ cookies[:key] = { value: "a yummy cookie", expires: 6.months }
588
413
 
589
- *Xavier Defrang*
414
+ Pull Request: #30121
590
415
 
591
- * Properly treat the entire IPv6 User Local Address space as private for
592
- purposes of remote IP detection. Also handle uppercase private IPv6
593
- addresses.
416
+ *Assain Jaleel*
594
417
 
595
- Fixes #12638.
418
+ * Enforce signed/encrypted cookie expiry server side.
596
419
 
597
- *Caleb Spare*
420
+ Rails can thwart attacks by malicious clients that don't honor a cookie's expiry.
598
421
 
599
- * Fixed an issue with migrating legacy json cookies.
422
+ It does so by stashing the expiry within the written cookie and relying on the
423
+ signing/encrypting to vouch that it hasn't been tampered with. Then on a
424
+ server-side read, the expiry is verified and any expired cookie is discarded.
600
425
 
601
- Previously, the `VerifyAndUpgradeLegacySignedMessage` assumes all incoming
602
- cookies are marshal-encoded. This is not the case when `secret_token` is
603
- used in conjunction with the `:json` or `:hybrid` serializer.
426
+ Pull Request: #30121
604
427
 
605
- In those case, when upgrading to use `secret_key_base`, this would cause a
606
- `TypeError: incompatible marshal file format` and a 500 error for the user.
428
+ *Assain Jaleel*
607
429
 
608
- Fixes #14774.
430
+ * Make `take_failed_screenshot` work within engine.
609
431
 
610
- *Godfrey Chan*
432
+ Fixes #30405.
611
433
 
612
- * Make URL escaping more consistent:
434
+ *Yuji Yaginuma*
613
435
 
614
- 1. Escape '%' characters in URLs - only unescaped data should be passed to URL helpers
615
- 2. Add an `escape_segment` helper to `Router::Utils` that escapes '/' characters
616
- 3. Use `escape_segment` rather than `escape_fragment` in optimized URL generation
617
- 4. Use `escape_segment` rather than `escape_path` in URL generation
436
+ * Deprecate `ActionDispatch::TestResponse` response aliases.
618
437
 
619
- For point 4 there are two exceptions. Firstly, when a route uses wildcard segments
620
- (e.g. `*foo`) then we use `escape_path` as the value may contain '/' characters. This
621
- means that wildcard routes can't be optimized. Secondly, if a `:controller` segment
622
- is used in the path then this uses `escape_path` as the controller may be namespaced.
438
+ `#success?`, `#missing?` & `#error?` are not supported by the actual
439
+ `ActionDispatch::Response` object and can produce false-positives. Instead,
440
+ use the response helpers provided by `Rack::Response`.
623
441
 
624
- Fixes #14629, #14636 and #14070.
442
+ *Trevor Wistaff*
625
443
 
626
- *Andrew White*, *Edho Arief*
444
+ * Protect from forgery by default
627
445
 
628
- * Add alias `ActionDispatch::Http::UploadedFile#to_io` to
629
- `ActionDispatch::Http::UploadedFile#tempfile`.
446
+ Rather than protecting from forgery in the generated `ApplicationController`,
447
+ add it to `ActionController::Base` depending on
448
+ `config.action_controller.default_protect_from_forgery`. This configuration
449
+ defaults to false to support older versions which have removed it from their
450
+ `ApplicationController`, but is set to true for Rails 5.2.
630
451
 
631
- *Tim Linquist*
452
+ *Lisa Ugray*
632
453
 
633
- * Returns null type format when format is not know and controller is using `any`
634
- format block.
454
+ * Fallback `ActionController::Parameters#to_s` to `Hash#to_s`.
635
455
 
636
- Fixes #14462.
456
+ *Kir Shatrov*
637
457
 
638
- *Rafael Mendonça França*
458
+ * `driven_by` now registers poltergeist and capybara-webkit.
639
459
 
640
- * Improve routing error page with fuzzy matching search.
460
+ If poltergeist or capybara-webkit are set as drivers is set for System Tests,
461
+ `driven_by` will register the driver and set additional options passed via
462
+ the `:options` parameter.
641
463
 
642
- *Winston*
464
+ Refer to the respective driver's documentation to see what options can be passed.
643
465
 
644
- * Only make deeply nested routes shallow when parent is shallow.
466
+ *Mario Chavez*
645
467
 
646
- Fixes #14684.
468
+ * AEAD encrypted cookies and sessions with GCM.
647
469
 
648
- *Andrew White*, *James Coglan*
470
+ Encrypted cookies now use AES-GCM which couples authentication and
471
+ encryption in one faster step and produces shorter ciphertexts. Cookies
472
+ encrypted using AES in CBC HMAC mode will be seamlessly upgraded when
473
+ this new mode is enabled via the
474
+ `action_dispatch.use_authenticated_cookie_encryption` configuration value.
649
475
 
650
- * Append link to bad code to backtrace when exception is `SyntaxError`.
476
+ *Michael J Coyne*
651
477
 
652
- *Boris Kuznetsov*
478
+ * Change the cache key format for fragments to make it easier to debug key churn. The new format is:
653
479
 
654
- * Swapped the parameters of assert_equal in `assert_select` so that the
655
- proper values were printed correctly.
480
+ views/template/action.html.erb:7a1156131a6928cb0026877f8b749ac9/projects/123
481
+ ^template path ^template tree digest ^class ^id
656
482
 
657
- Fixes #14422.
483
+ *DHH*
658
484
 
659
- *Vishal Lal*
485
+ * Add support for recyclable cache keys with fragment caching. This uses the new versioned entries in the
486
+ `ActiveSupport::Cache` stores and relies on the fact that Active Record has split `#cache_key` and `#cache_version`
487
+ to support it.
660
488
 
661
- * The method `shallow?` returns false if the parent resource is a singleton so
662
- we need to check if we're not inside a nested scope before copying the :path
663
- and :as options to their shallow equivalents.
489
+ *DHH*
664
490
 
665
- Fixes #14388.
491
+ * Add `action_controller_api` and `action_controller_base` load hooks to be called in `ActiveSupport.on_load`
666
492
 
667
- *Andrew White*
493
+ `ActionController::Base` and `ActionController::API` have differing implementations. This means that
494
+ the one umbrella hook `action_controller` is not able to address certain situations where a method
495
+ may not exist in a certain implementation.
668
496
 
669
- * Make logging of CSRF failures optional (but on by default) with the
670
- `log_warning_on_csrf_failure` configuration setting in
671
- `ActionController::RequestForgeryProtection`.
497
+ This is fixed by adding two new hooks so you can target `ActionController::Base` vs `ActionController::API`
672
498
 
673
- *John Barton*
499
+ Fixes #27013.
674
500
 
675
- * Fix URL generation in controller tests with request-dependent
676
- `default_url_options` methods.
501
+ *Julian Nadeau*
677
502
 
678
- *Tony Wooster*
679
503
 
680
- Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md) for previous changes.
504
+ Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actionpack/CHANGELOG.md) for previous changes.