actionpack 3.2.19 → 4.2.11.3

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 (244) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +412 -503
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +11 -294
  5. data/lib/abstract_controller/asset_paths.rb +2 -2
  6. data/lib/abstract_controller/base.rb +52 -18
  7. data/lib/abstract_controller/callbacks.rb +87 -89
  8. data/lib/abstract_controller/collector.rb +17 -3
  9. data/lib/abstract_controller/helpers.rb +41 -14
  10. data/lib/abstract_controller/logger.rb +1 -2
  11. data/lib/abstract_controller/railties/routes_helpers.rb +3 -3
  12. data/lib/abstract_controller/rendering.rb +65 -118
  13. data/lib/abstract_controller/translation.rb +16 -1
  14. data/lib/abstract_controller/url_for.rb +7 -7
  15. data/lib/abstract_controller.rb +2 -10
  16. data/lib/action_controller/base.rb +61 -28
  17. data/lib/action_controller/caching/fragments.rb +30 -54
  18. data/lib/action_controller/caching.rb +38 -35
  19. data/lib/action_controller/log_subscriber.rb +35 -18
  20. data/lib/action_controller/metal/conditional_get.rb +103 -34
  21. data/lib/action_controller/metal/data_streaming.rb +20 -26
  22. data/lib/action_controller/metal/etag_with_template_digest.rb +50 -0
  23. data/lib/action_controller/metal/exceptions.rb +19 -6
  24. data/lib/action_controller/metal/flash.rb +41 -9
  25. data/lib/action_controller/metal/force_ssl.rb +70 -12
  26. data/lib/action_controller/metal/head.rb +30 -7
  27. data/lib/action_controller/metal/helpers.rb +11 -11
  28. data/lib/action_controller/metal/hide_actions.rb +0 -1
  29. data/lib/action_controller/metal/http_authentication.rb +140 -94
  30. data/lib/action_controller/metal/implicit_render.rb +1 -1
  31. data/lib/action_controller/metal/instrumentation.rb +11 -7
  32. data/lib/action_controller/metal/live.rb +328 -0
  33. data/lib/action_controller/metal/mime_responds.rb +161 -152
  34. data/lib/action_controller/metal/params_wrapper.rb +126 -81
  35. data/lib/action_controller/metal/rack_delegation.rb +10 -4
  36. data/lib/action_controller/metal/redirecting.rb +44 -41
  37. data/lib/action_controller/metal/renderers.rb +48 -19
  38. data/lib/action_controller/metal/rendering.rb +46 -11
  39. data/lib/action_controller/metal/request_forgery_protection.rb +250 -29
  40. data/lib/action_controller/metal/streaming.rb +30 -38
  41. data/lib/action_controller/metal/strong_parameters.rb +669 -0
  42. data/lib/action_controller/metal/testing.rb +12 -18
  43. data/lib/action_controller/metal/url_for.rb +31 -29
  44. data/lib/action_controller/metal.rb +31 -40
  45. data/lib/action_controller/model_naming.rb +12 -0
  46. data/lib/action_controller/railtie.rb +38 -18
  47. data/lib/action_controller/railties/helpers.rb +22 -0
  48. data/lib/action_controller/test_case.rb +359 -173
  49. data/lib/action_controller.rb +9 -16
  50. data/lib/action_dispatch/http/cache.rb +64 -11
  51. data/lib/action_dispatch/http/filter_parameters.rb +20 -10
  52. data/lib/action_dispatch/http/filter_redirect.rb +38 -0
  53. data/lib/action_dispatch/http/headers.rb +85 -17
  54. data/lib/action_dispatch/http/mime_negotiation.rb +55 -5
  55. data/lib/action_dispatch/http/mime_type.rb +167 -114
  56. data/lib/action_dispatch/http/mime_types.rb +2 -1
  57. data/lib/action_dispatch/http/parameter_filter.rb +44 -46
  58. data/lib/action_dispatch/http/parameters.rb +30 -46
  59. data/lib/action_dispatch/http/rack_cache.rb +2 -3
  60. data/lib/action_dispatch/http/request.rb +108 -45
  61. data/lib/action_dispatch/http/response.rb +247 -48
  62. data/lib/action_dispatch/http/upload.rb +60 -29
  63. data/lib/action_dispatch/http/url.rb +135 -45
  64. data/lib/action_dispatch/journey/backwards.rb +5 -0
  65. data/lib/action_dispatch/journey/formatter.rb +166 -0
  66. data/lib/action_dispatch/journey/gtg/builder.rb +162 -0
  67. data/lib/action_dispatch/journey/gtg/simulator.rb +47 -0
  68. data/lib/action_dispatch/journey/gtg/transition_table.rb +157 -0
  69. data/lib/action_dispatch/journey/nfa/builder.rb +76 -0
  70. data/lib/action_dispatch/journey/nfa/dot.rb +36 -0
  71. data/lib/action_dispatch/journey/nfa/simulator.rb +47 -0
  72. data/lib/action_dispatch/journey/nfa/transition_table.rb +163 -0
  73. data/lib/action_dispatch/journey/nodes/node.rb +128 -0
  74. data/lib/action_dispatch/journey/parser.rb +198 -0
  75. data/lib/action_dispatch/journey/parser.y +49 -0
  76. data/lib/action_dispatch/journey/parser_extras.rb +23 -0
  77. data/lib/action_dispatch/journey/path/pattern.rb +193 -0
  78. data/lib/action_dispatch/journey/route.rb +125 -0
  79. data/lib/action_dispatch/journey/router/strexp.rb +27 -0
  80. data/lib/action_dispatch/journey/router/utils.rb +93 -0
  81. data/lib/action_dispatch/journey/router.rb +144 -0
  82. data/lib/action_dispatch/journey/routes.rb +80 -0
  83. data/lib/action_dispatch/journey/scanner.rb +61 -0
  84. data/lib/action_dispatch/journey/visitors.rb +221 -0
  85. data/lib/action_dispatch/journey/visualizer/fsm.css +30 -0
  86. data/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
  87. data/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
  88. data/lib/action_dispatch/journey.rb +5 -0
  89. data/lib/action_dispatch/middleware/callbacks.rb +16 -11
  90. data/lib/action_dispatch/middleware/cookies.rb +346 -125
  91. data/lib/action_dispatch/middleware/debug_exceptions.rb +52 -24
  92. data/lib/action_dispatch/middleware/exception_wrapper.rb +75 -9
  93. data/lib/action_dispatch/middleware/flash.rb +85 -72
  94. data/lib/action_dispatch/middleware/params_parser.rb +16 -31
  95. data/lib/action_dispatch/middleware/public_exceptions.rb +39 -14
  96. data/lib/action_dispatch/middleware/reloader.rb +16 -7
  97. data/lib/action_dispatch/middleware/remote_ip.rb +132 -40
  98. data/lib/action_dispatch/middleware/request_id.rb +3 -7
  99. data/lib/action_dispatch/middleware/session/abstract_store.rb +22 -20
  100. data/lib/action_dispatch/middleware/session/cache_store.rb +3 -3
  101. data/lib/action_dispatch/middleware/session/cookie_store.rb +84 -29
  102. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +8 -3
  103. data/lib/action_dispatch/middleware/show_exceptions.rb +15 -44
  104. data/lib/action_dispatch/middleware/ssl.rb +72 -0
  105. data/lib/action_dispatch/middleware/stack.rb +6 -1
  106. data/lib/action_dispatch/middleware/static.rb +80 -23
  107. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +34 -0
  108. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +23 -0
  109. data/lib/action_dispatch/middleware/templates/rescues/_source.erb +27 -0
  110. data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +52 -0
  111. data/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +9 -0
  112. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +16 -0
  113. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +9 -0
  114. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +133 -5
  115. data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +11 -0
  116. data/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +3 -0
  117. data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +32 -0
  118. data/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +11 -0
  119. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +20 -0
  120. data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +7 -0
  121. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +6 -0
  122. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +3 -0
  123. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
  124. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +200 -0
  125. data/lib/action_dispatch/railtie.rb +19 -6
  126. data/lib/action_dispatch/request/session.rb +193 -0
  127. data/lib/action_dispatch/request/utils.rb +35 -0
  128. data/lib/action_dispatch/routing/endpoint.rb +10 -0
  129. data/lib/action_dispatch/routing/inspector.rb +234 -0
  130. data/lib/action_dispatch/routing/mapper.rb +897 -436
  131. data/lib/action_dispatch/routing/polymorphic_routes.rb +213 -92
  132. data/lib/action_dispatch/routing/redirection.rb +97 -37
  133. data/lib/action_dispatch/routing/route_set.rb +432 -239
  134. data/lib/action_dispatch/routing/routes_proxy.rb +7 -4
  135. data/lib/action_dispatch/routing/url_for.rb +63 -34
  136. data/lib/action_dispatch/routing.rb +57 -89
  137. data/lib/action_dispatch/testing/assertions/dom.rb +2 -36
  138. data/lib/action_dispatch/testing/assertions/response.rb +24 -38
  139. data/lib/action_dispatch/testing/assertions/routing.rb +55 -54
  140. data/lib/action_dispatch/testing/assertions/selector.rb +2 -434
  141. data/lib/action_dispatch/testing/assertions/tag.rb +2 -137
  142. data/lib/action_dispatch/testing/assertions.rb +11 -7
  143. data/lib/action_dispatch/testing/integration.rb +88 -72
  144. data/lib/action_dispatch/testing/test_process.rb +9 -6
  145. data/lib/action_dispatch/testing/test_request.rb +13 -9
  146. data/lib/action_dispatch/testing/test_response.rb +1 -5
  147. data/lib/action_dispatch.rb +24 -21
  148. data/lib/action_pack/gem_version.rb +15 -0
  149. data/lib/action_pack/version.rb +5 -7
  150. data/lib/action_pack.rb +1 -1
  151. metadata +181 -292
  152. data/lib/abstract_controller/layouts.rb +0 -423
  153. data/lib/abstract_controller/view_paths.rb +0 -96
  154. data/lib/action_controller/caching/actions.rb +0 -185
  155. data/lib/action_controller/caching/pages.rb +0 -187
  156. data/lib/action_controller/caching/sweeping.rb +0 -97
  157. data/lib/action_controller/deprecated/integration_test.rb +0 -2
  158. data/lib/action_controller/deprecated/performance_test.rb +0 -1
  159. data/lib/action_controller/deprecated.rb +0 -3
  160. data/lib/action_controller/metal/compatibility.rb +0 -65
  161. data/lib/action_controller/metal/responder.rb +0 -286
  162. data/lib/action_controller/metal/session_management.rb +0 -14
  163. data/lib/action_controller/railties/paths.rb +0 -25
  164. data/lib/action_controller/record_identifier.rb +0 -85
  165. data/lib/action_controller/vendor/html-scanner/html/document.rb +0 -68
  166. data/lib/action_controller/vendor/html-scanner/html/node.rb +0 -532
  167. data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +0 -177
  168. data/lib/action_controller/vendor/html-scanner/html/selector.rb +0 -830
  169. data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +0 -107
  170. data/lib/action_controller/vendor/html-scanner/html/version.rb +0 -11
  171. data/lib/action_controller/vendor/html-scanner.rb +0 -20
  172. data/lib/action_dispatch/middleware/best_standards_support.rb +0 -30
  173. data/lib/action_dispatch/middleware/body_proxy.rb +0 -30
  174. data/lib/action_dispatch/middleware/head.rb +0 -18
  175. data/lib/action_dispatch/middleware/rescue.rb +0 -26
  176. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +0 -31
  177. data/lib/action_dispatch/middleware/templates/rescues/_trace.erb +0 -26
  178. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb +0 -10
  179. data/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +0 -2
  180. data/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +0 -15
  181. data/lib/action_dispatch/middleware/templates/rescues/template_error.erb +0 -17
  182. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb +0 -2
  183. data/lib/action_dispatch/testing/performance_test.rb +0 -10
  184. data/lib/action_view/asset_paths.rb +0 -142
  185. data/lib/action_view/base.rb +0 -220
  186. data/lib/action_view/buffers.rb +0 -43
  187. data/lib/action_view/context.rb +0 -36
  188. data/lib/action_view/flows.rb +0 -79
  189. data/lib/action_view/helpers/active_model_helper.rb +0 -50
  190. data/lib/action_view/helpers/asset_paths.rb +0 -7
  191. data/lib/action_view/helpers/asset_tag_helper.rb +0 -457
  192. data/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb +0 -146
  193. data/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb +0 -93
  194. data/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +0 -193
  195. data/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +0 -148
  196. data/lib/action_view/helpers/atom_feed_helper.rb +0 -200
  197. data/lib/action_view/helpers/cache_helper.rb +0 -64
  198. data/lib/action_view/helpers/capture_helper.rb +0 -203
  199. data/lib/action_view/helpers/controller_helper.rb +0 -25
  200. data/lib/action_view/helpers/csrf_helper.rb +0 -32
  201. data/lib/action_view/helpers/date_helper.rb +0 -1062
  202. data/lib/action_view/helpers/debug_helper.rb +0 -40
  203. data/lib/action_view/helpers/form_helper.rb +0 -1486
  204. data/lib/action_view/helpers/form_options_helper.rb +0 -658
  205. data/lib/action_view/helpers/form_tag_helper.rb +0 -685
  206. data/lib/action_view/helpers/javascript_helper.rb +0 -110
  207. data/lib/action_view/helpers/number_helper.rb +0 -622
  208. data/lib/action_view/helpers/output_safety_helper.rb +0 -38
  209. data/lib/action_view/helpers/record_tag_helper.rb +0 -111
  210. data/lib/action_view/helpers/rendering_helper.rb +0 -90
  211. data/lib/action_view/helpers/sanitize_helper.rb +0 -259
  212. data/lib/action_view/helpers/tag_helper.rb +0 -160
  213. data/lib/action_view/helpers/text_helper.rb +0 -426
  214. data/lib/action_view/helpers/translation_helper.rb +0 -91
  215. data/lib/action_view/helpers/url_helper.rb +0 -693
  216. data/lib/action_view/helpers.rb +0 -60
  217. data/lib/action_view/locale/en.yml +0 -160
  218. data/lib/action_view/log_subscriber.rb +0 -28
  219. data/lib/action_view/lookup_context.rb +0 -254
  220. data/lib/action_view/path_set.rb +0 -89
  221. data/lib/action_view/railtie.rb +0 -55
  222. data/lib/action_view/renderer/abstract_renderer.rb +0 -41
  223. data/lib/action_view/renderer/partial_renderer.rb +0 -415
  224. data/lib/action_view/renderer/renderer.rb +0 -54
  225. data/lib/action_view/renderer/streaming_template_renderer.rb +0 -106
  226. data/lib/action_view/renderer/template_renderer.rb +0 -94
  227. data/lib/action_view/template/error.rb +0 -128
  228. data/lib/action_view/template/handlers/builder.rb +0 -26
  229. data/lib/action_view/template/handlers/erb.rb +0 -125
  230. data/lib/action_view/template/handlers.rb +0 -50
  231. data/lib/action_view/template/resolver.rb +0 -272
  232. data/lib/action_view/template/text.rb +0 -30
  233. data/lib/action_view/template.rb +0 -337
  234. data/lib/action_view/test_case.rb +0 -245
  235. data/lib/action_view/testing/resolvers.rb +0 -50
  236. data/lib/action_view.rb +0 -84
  237. data/lib/sprockets/assets.rake +0 -99
  238. data/lib/sprockets/bootstrap.rb +0 -37
  239. data/lib/sprockets/compressors.rb +0 -83
  240. data/lib/sprockets/helpers/isolated_helper.rb +0 -13
  241. data/lib/sprockets/helpers/rails_helper.rb +0 -182
  242. data/lib/sprockets/helpers.rb +0 -6
  243. data/lib/sprockets/railtie.rb +0 -62
  244. data/lib/sprockets/static_compiler.rb +0 -56
data/CHANGELOG.md CHANGED
@@ -1,781 +1,690 @@
1
- ## Rails 3.2.19 (Jul 2, 2014) ##
1
+ ## Rails 4.2.11.3 (May 15, 2020) ##
2
2
 
3
- * Fix regression when using `ActionView::Helpers::TranslationHelper#translate` with
4
- `options[:raise]`.
5
-
6
- This regression was introduced at ec16ba75a5493b9da972eea08bae630eba35b62f.
7
-
8
- *Shota Fukumori (sora_h)*
9
-
10
-
11
- ## Rails 3.2.18 (May 6, 2014) ##
12
-
13
- * Only accept actions without File::SEPARATOR in the name.
14
-
15
- This will avoid directory traversal in implicit render.
16
-
17
- Fixes: CVE-2014-0130
18
-
19
- *Rafael Mendonça França*
3
+ * No changes.
20
4
 
21
5
 
22
- ## Rails 3.2.17 (Feb 18, 2014) ##
6
+ ## Rails 4.2.11.2 (May 15, 2020) ##
23
7
 
24
- * Use the reference for the mime type to get the format
8
+ * No changes.
25
9
 
26
- Fixes: CVE-2014-0082
27
10
 
28
- * Escape format, negative_format and units options of number helpers
11
+ ## Rails 4.2.11.1 (March 11, 2019) ##
29
12
 
30
- Fixes: CVE-2014-0081
13
+ * No changes.
31
14
 
32
15
 
33
- ## Rails 3.2.16 (Dec 12, 2013) ##
16
+ ## Rails 4.2.11 (November 27, 2018) ##
34
17
 
35
- * Deep Munge the parameters for GET and POST Fixes CVE-2013-6417
18
+ * No changes.
36
19
 
37
- * Stop using i18n's built in HTML error handling. Fixes: CVE-2013-4491
38
20
 
39
- * Escape the unit value provided to number_to_currency Fixes CVE-2013-6415
21
+ ## Rails 4.2.10 (September 27, 2017) ##
40
22
 
41
- * Only use valid mime type symbols as cache keys CVE-2013-6414
23
+ * Fix regression in behavior of `normalize_path`.
42
24
 
43
- ## Rails 3.2.15 (Oct 16, 2013) ##
25
+ In Rails 5 there was a change to ensure the encoding of the original string
26
+ in a path was maintained. This was incorrectly backported to Rails 4.2 which
27
+ caused a regression.
44
28
 
45
- * Fix `ActionDispatch::RemoteIp::GetIp#calculate_ip` to only check for spoofing
46
- attacks if both `HTTP_CLIENT_IP` and `HTTP_X_FORWARDED_FOR` are set.
29
+ *Eileen M. Uchitelle*
47
30
 
48
- Fixes #12410
49
- Backports #10844
31
+ ## Rails 4.2.9 (June 26, 2017) ##
50
32
 
51
- *Tamir Duberstein*
33
+ * Use more specific check for :format in route path
52
34
 
53
- * Fix the assert_recognizes test method so that it works when there are
54
- constraints on the querystring.
35
+ The current check for whether to add an optional format to the path is very lax
36
+ and will match things like `:format_id` where there are nested resources, e.g:
55
37
 
56
- Issue/Pull Request #9368
57
- Backport #5219
38
+ ``` ruby
39
+ resources :formats do
40
+ resources :items
41
+ end
42
+ ```
58
43
 
59
- *Brian Hahn*
44
+ Fix this by using a more restrictive regex pattern that looks for the patterns
45
+ `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
46
+ allow for multiple closing parenthesis since the route may be of this form:
60
47
 
61
- * Fix to render partial by context(#11605).
48
+ ``` ruby
49
+ get "/books(/:action(.:format))", controller: "books"
50
+ ```
62
51
 
63
- *Kassio Borges*
52
+ This probably isn't what's intended since it means that the default index action
53
+ route doesn't support a format but we have a test for it so we need to allow it.
64
54
 
65
- * Fix `ActionDispatch::Assertions::ResponseAssertions#assert_redirected_to`
66
- does not show user-supplied message.
55
+ Fixes #28517.
67
56
 
68
- Issue: when `assert_redirected_to` fails due to the response redirect not
69
- matching the expected redirect the user-supplied message (second parameter)
70
- is not shown. This message is only shown if the response is not a redirect.
57
+ *Andrew White*
71
58
 
72
- *Alexey Chernenkov*
73
59
 
60
+ ## Rails 4.2.8 (February 21, 2017) ##
74
61
 
75
- ## Rails 3.2.14 (Jul 22, 2013) ##
62
+ * No changes.
76
63
 
77
- * Merge `:action` from routing scope and assign endpoint if both `:controller`
78
- and `:action` are present. The endpoint assignment only occurs if there is
79
- no `:to` present in the options hash so should only affect routes using the
80
- shorthand syntax (i.e. endpoint is inferred from the the path).
81
64
 
82
- Fixes #9856
65
+ ## Rails 4.2.7 (July 12, 2016) ##
83
66
 
84
- *Yves Senn*, *Andrew White*
67
+ * No changes.
85
68
 
86
- * Always escape the result of `link_to_unless` method.
87
69
 
88
- Before:
70
+ ## Rails 4.2.6 (March 07, 2016) ##
89
71
 
90
- link_to_unless(true, '<b>Showing</b>', 'github.com')
91
- # => "<b>Showing</b>"
72
+ * No changes.
92
73
 
93
- After:
94
74
 
95
- link_to_unless(true, '<b>Showing</b>', 'github.com')
96
- # => "&lt;b&gt;Showing&lt;/b&gt;"
75
+ ## Rails 4.2.5.2 (February 26, 2016) ##
97
76
 
98
- *dtaniwaki*
77
+ * Do not allow render with unpermitted parameter.
99
78
 
100
- * Use a case insensitive URI Regexp for #asset_path.
79
+ Fixes CVE-2016-2098.
101
80
 
102
- This fix a problem where the same asset path using different case are generating
103
- different URIs.
81
+ *Arthur Neves*
104
82
 
105
- Before:
106
83
 
107
- image_tag("HTTP://google.com")
108
- # => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
109
- image_tag("http://google.com")
110
- # => "<img alt=\"Google\" src=\"http://google.com\" />"
84
+ ## Rails 4.2.5.1 (January 25, 2015) ##
111
85
 
112
- After:
86
+ * No changes.
113
87
 
114
- image_tag("HTTP://google.com")
115
- # => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
116
- image_tag("http://google.com")
117
- # => "<img alt=\"Google\" src=\"http://google.com\" />"
118
88
 
119
- *David Celis + Rafael Mendonça França*
89
+ ## Rails 4.2.5 (November 12, 2015) ##
120
90
 
121
- * Fix explicit names on multiple file fields. If a file field tag has
122
- the multiple option, it is turned into an array field (appending `[]`),
123
- but if an explicit name is passed to `file_field` the `[]` is not
124
- appended.
125
- Fixes #9830.
91
+ * `ActionController::TestCase` can teardown gracefully if an error is raised
92
+ early in the `setup` chain.
126
93
 
127
- *Ryan McGeary*
94
+ *Yves Senn*
128
95
 
129
- * Fix assets loading performance in 3.2.13.
96
+ * Parse RSS/ATOM responses as XML, not HTML.
130
97
 
131
- Issue #8756 uses Sprockets for resolving files that already exist on disk,
132
- for those files their extensions don't need to be rewritten.
98
+ *Alexander Kaupanin*
133
99
 
134
- Fixes #9803.
100
+ * Fix regression in mounted engine named routes generation for app deployed to
101
+ a subdirectory. `relative_url_root` was prepended to the path twice (e.g.
102
+ "/subdir/subdir/engine_path" instead of "/subdir/engine_path")
135
103
 
136
- *Fred Wu*
104
+ Fixes #20920. Fixes #21459.
137
105
 
138
- * Fix `ActionController#action_missing` not being called.
139
- Fixes #9799.
106
+ *Matthew Erhard*
140
107
 
141
- *Janko Luin*
108
+ * `url_for` does not modify its arguments when generating polymorphic URLs.
142
109
 
143
- * `ActionView::Helpers::NumberHelper#number_to_human` returns the number unaltered when
144
- the units hash does not contain the needed key, e.g. when the number provided is less
145
- than the largest key provided.
110
+ *Bernerd Schaefer*
146
111
 
147
- Examples:
112
+ * Update `ActionController::TestSession#fetch` to behave more like
113
+ `ActionDispatch::Request::Session#fetch` when using non-string keys.
148
114
 
149
- number_to_human(123, units: {}) # => 123
150
- number_to_human(123, units: { thousand: 'k' }) # => 123
115
+ *Jeremy Friesen*
151
116
 
152
- Fixes #9269.
153
- Backport #9347.
154
117
 
155
- *Michael Hoffman*
118
+ ## Rails 4.2.4 (August 24, 2015) ##
156
119
 
157
- * Include I18n locale fallbacks in view lookup.
158
- Fixes GH#3512.
120
+ * ActionController::TestSession now accepts a default value as well as
121
+ a block for generating a default value based off the key provided.
159
122
 
160
- *Juan Barreneche*
123
+ This fixes calls to session#fetch in ApplicationController instances that
124
+ take more two arguments or a block from raising `ArgumentError: wrong
125
+ number of arguments (2 for 1)` when performing controller tests.
161
126
 
162
- * Fix `ActionDispatch::Request#formats` when the Accept request-header is an
163
- empty string. Fix #7774 [Backport #8977, #9541]
127
+ *Matthew Gerrior*
164
128
 
165
- *Soylent + Maxime Réty*
129
+ * Fix to keep original header instance in `ActionDispatch::SSL`
166
130
 
131
+ `ActionDispatch::SSL` changes headers to `Hash`.
132
+ So some headers will be broken if there are some middlewares
133
+ on `ActionDispatch::SSL` and if it uses `Rack::Utils::HeaderHash`.
167
134
 
168
- ## Rails 3.2.13 (Mar 18, 2013) ##
135
+ *Fumiaki Matsushima*
169
136
 
170
- * Fix incorrectly appended square brackets to a multiple select box
171
- if an explicit name has been given and it already ends with "[]".
172
137
 
173
- Before:
138
+ ## Rails 4.2.3 (June 25, 2015) ##
174
139
 
175
- select(:category, [], {}, multiple: true, name: "post[category][]")
176
- # => <select name="post[category][][]" ...>
140
+ * Fix rake routes not showing the right format when
141
+ nesting multiple routes.
177
142
 
178
- After:
143
+ See #18373.
179
144
 
180
- select(:category, [], {}, multiple: true, name: "post[category][]")
181
- # => <select name="post[category][]" ...>
145
+ *Ravil Bayramgalin*
182
146
 
183
- Backport #9616.
147
+ * Fix regression where a gzip file response would have a Content-type,
148
+ even when it was a 304 status code.
184
149
 
185
- *Olek Janiszewski*
150
+ See #19271.
186
151
 
187
- * Determine the controller#action from only the matched path when using the
188
- shorthand syntax. Previously the complete path was used, which led
189
- to problems with nesting (scopes and namespaces).
190
- Fixes #7554.
191
- Backport #9361.
152
+ *Kohei Suzuki*
192
153
 
193
- Example:
154
+ * Fix handling of empty X_FORWARDED_HOST header in raw_host_with_port
194
155
 
195
- # this will route to questions#new
196
- scope ':locale' do
197
- get 'questions/new'
198
- end
156
+ Previously, an empty X_FORWARDED_HOST header would cause
157
+ Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
158
+ Actiondispatch::Http:URL.host to raise a NoMethodError.
199
159
 
200
- *Yves Senn*
160
+ *Adam Forsyth*
201
161
 
202
- * Fix `assert_template` with `render :stream => true`.
203
- Fix #1743.
204
- Backport #5288.
162
+ * Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
205
163
 
206
- *Sergey Nartimov*
164
+ Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not
165
+ prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack)
166
+ is set, it takes precedence.
207
167
 
208
- * Eagerly populate the http method lookup cache so local project inflections do
209
- not interfere with use of underscore method ( and we don't need locks )
168
+ Fixes #5122.
210
169
 
211
- *Aditya Sanghi*
170
+ *Yasyf Mohamedali*
212
171
 
213
- * `BestStandardsSupport` no longer duplicates `X-UA-Compatible` values on
214
- each request to prevent header size from blowing up.
172
+ * Fix regression in functional tests. Responses should have default headers
173
+ assigned.
215
174
 
216
- *Edward Anderson*
175
+ See #18423.
217
176
 
218
- * Fixed JSON params parsing regression for non-object JSON content.
177
+ *Jeremy Kemper*, *Yves Senn*
219
178
 
220
- *Dylan Smith*
221
179
 
222
- * Prevent unnecessary asset compilation when using `javascript_include_tag` on
223
- files with non-standard extensions.
180
+ ## Rails 4.2.2 (June 16, 2015) ##
224
181
 
225
- *Noah Silas*
182
+ * No Changes *
226
183
 
227
- * Fixes issue where duplicate assets can be required with sprockets.
228
184
 
229
- *Jeremy Jackson*
185
+ ## Rails 4.2.1 (March 19, 2015) ##
230
186
 
231
- * Bump `rack` dependency to 1.4.3, eliminate `Rack::File` headers deprecation warning.
187
+ * Non-string authenticity tokens do not raise NoMethodError when decoding
188
+ the masked token.
232
189
 
233
- *Sam Ruby + Carlos Antonio da Silva*
190
+ *Ville Lautanala*
234
191
 
235
- * Do not append second slash to `root_url` when using `trailing_slash: true`
192
+ * Explicitly ignored wildcard verbs when searching for HEAD routes before fallback
236
193
 
237
- Fix #8700.
238
- Backport #8701.
194
+ Fixes an issue where a mounted rack app at root would intercept the HEAD
195
+ request causing an incorrect behavior during the fall back to GET requests.
239
196
 
240
197
  Example:
241
- # before
242
- root_url # => http://test.host//
198
+ ```ruby
199
+ draw do
200
+ get '/home' => 'test#index'
201
+ mount rack_app, at: '/'
202
+ end
203
+ head '/home'
204
+ assert_response :success
205
+ ```
206
+ In this case, a HEAD request runs through the routes the first time and fails
207
+ to match anything. Then, it runs through the list with the fallback and matches
208
+ `get '/home'`. The original behavior would match the rack app in the first pass.
243
209
 
244
- # after
245
- root_url # => http://test.host/
210
+ *Terence Sun*
246
211
 
247
- *Yves Senn*
212
+ * Preserve default format when generating URLs
248
213
 
249
- * Fix a bug in `content_tag_for` that prevents it for work without a block.
214
+ Fixes an issue that would cause the format set in default_url_options to be
215
+ lost when generating URLs with fewer positional arguments than parameters in
216
+ the route definition.
250
217
 
251
- *Jasl*
218
+ Backport of #18627
252
219
 
253
- * Clear url helper methods when routes are reloaded by removing the methods
254
- explicitly rather than just clearing the module because it didn't work
255
- properly and could be the source of a memory leak.
220
+ *Tekin Suleyman*, *Dominic Baggott*
256
221
 
257
- *Andrew White*
258
-
259
- * Fix a bug in `ActionDispatch::Request#raw_post` that caused `env['rack.input']`
260
- to be read but not rewound.
261
-
262
- *Matt Venables*
263
-
264
- * More descriptive error messages when calling `render :partial` with
265
- an invalid `:layout` argument.
266
-
267
- Fixes #8376.
268
-
269
- render :partial => 'partial', :layout => true
270
- # results in ActionView::MissingTemplate: Missing partial /true
271
-
272
- *Yves Senn*
273
-
274
- * Accept symbols as `#send_data` :disposition value. [Backport #8329] *Elia Schito*
275
-
276
- * Add i18n scope to `distance_of_time_in_words`. [Backport #7997] *Steve Klabnik*
277
-
278
- * Fix side effect of `url_for` changing the `:controller` string option. [Backport #6003]
279
- Before:
222
+ * Default headers, removed in controller actions, are no longer reapplied on
223
+ the test response.
280
224
 
281
- controller = '/projects'
282
- url_for :controller => controller, :action => 'status'
225
+ *Jonas Baumann*
283
226
 
284
- puts controller #=> 'projects'
227
+ * Ensure `append_info_to_payload` is called even if an exception is raised.
285
228
 
286
- After
229
+ Fixes an issue where when an exception is raised in the request the additonal
230
+ payload data is not available.
287
231
 
288
- puts controller #=> '/projects'
232
+ See:
233
+ * #14903
234
+ * https://github.com/roidrage/lograge/issues/37
289
235
 
290
- *Nikita Beloglazov + Andrew White*
236
+ *Dieter Komendera*, *Margus Pärt*
291
237
 
292
- * Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`. This is a list
293
- of mime types where template text is not html escaped by default. It prevents `Jack & Joe`
294
- from rendering as `Jack &amp; Joe` for the whitelisted mime types. The default whitelist
295
- contains text/plain. Fix #7976 [Backport #8235]
238
+ * Correctly rely on the response's status code to handle calls to `head`.
296
239
 
297
- *Joost Baaij*
240
+ *Robin Dupret*
298
241
 
299
- * `BestStandardsSupport` middleware now appends it's `X-UA-Compatible` value to app's
300
- returned value if any. Fix #8086 [Backport #8093]
242
+ * Using `head` method returns empty response_body instead
243
+ of returning a single space " ".
301
244
 
302
- *Nikita Afanasenko*
245
+ The old behavior was added as a workaround for a bug in an early
246
+ version of Safari, where the HTTP headers are not returned correctly
247
+ if the response body has a 0-length. This is been fixed since and
248
+ the workaround is no longer necessary.
303
249
 
304
- * prevent double slashes in engine urls when `Rails.application.default_url_options[:trailing_slash] = true` is set
305
- Fix #7842
250
+ Fixes #18253.
306
251
 
307
- *Yves Senn*
252
+ *Prathamesh Sonpatki*
308
253
 
309
- * Fix input name when `:multiple => true` and `:index` are set.
254
+ * Fix how polymorphic routes works with objects that implement `to_model`.
310
255
 
311
- Before:
256
+ *Travis Grathwell*
312
257
 
313
- check_box("post", "comment_ids", { :multiple => true, :index => "foo" }, 1)
314
- #=> <input name=\"post[foo][comment_ids]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids]\" type=\"checkbox\" value=\"1\" />
258
+ * Fixed handling of positional url helper arguments when `format: false`.
315
259
 
316
- After:
260
+ Fixes #17819.
317
261
 
318
- check_box("post", "comment_ids", { :multiple => true, :index => "foo" }, 1)
319
- #=> <input name=\"post[foo][comment_ids][]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids][]\" type=\"checkbox\" value=\"1\" />
262
+ *Andrew White*, *Tatiana Soukiassian*
320
263
 
321
- Fix #8108
264
+ * Fixed usage of optional scopes in URL helpers.
322
265
 
323
- *Daniel Fox, Grant Hutchins & Trace Wax*
266
+ *Alex Robbin*
324
267
 
325
268
 
326
- ## Rails 3.2.12 (Feb 11, 2013) ##
269
+ ## Rails 4.2.0 (December 20, 2014) ##
327
270
 
328
- * No changes.
271
+ * Add `ActionController::Parameters#to_unsafe_h` to return an unfiltered
272
+ `Hash` representation of Parameters object. This is now a preferred way to
273
+ retrieve unfiltered parameters as we will stop inheriting `AC::Parameters`
274
+ object in Rails 5.0.
329
275
 
276
+ *Prem Sichanugrist*
330
277
 
331
- ## Rails 3.2.11 (Jan 8, 2013) ##
278
+ * Restore handling of a bare `Authorization` header, without `token=`
279
+ prefix.
332
280
 
333
- * Strip nils from collections on JSON and XML posts. [CVE-2013-0155]
281
+ Fixes #17108.
334
282
 
283
+ *Guo Xiang Tan*
335
284
 
336
- ## Rails 3.2.10 (Jan 2, 2013) ##
285
+ * Deprecate use of string keys in URL helpers.
337
286
 
338
- * No changes.
287
+ Use symbols instead.
288
+ Fixes #16958.
339
289
 
290
+ *Byron Bischoff*, *Melanie Gilman*
340
291
 
341
- ## Rails 3.2.9 (Nov 12, 2012) ##
292
+ * Deprecate the `only_path` option on `*_path` helpers.
342
293
 
343
- * Clear url helpers when reloading routes.
294
+ In cases where this option is set to `true`, the option is redundant and can
295
+ be safely removed; otherwise, the corresponding `*_url` helper should be
296
+ used instead.
344
297
 
345
- *Santiago Pastorino*
298
+ Fixes #17294.
346
299
 
347
- * Revert the shorthand routes scoped with `:module` option fix
348
- This added a regression since it is changing the URL mapping.
349
- This makes the stable release backward compatible.
300
+ *Dan Olson*, *Godfrey Chan*
350
301
 
351
- *Rafael Mendonça França*
302
+ * Improve Journey compliance to RFC 3986.
352
303
 
353
- * Revert the `assert_template` fix to not pass with ever string that matches the template name.
354
- This added a regression since people were relying on this buggy behavior.
355
- This will introduce back #3849 but this stable release will be backward compatible.
356
- Fixes #8068.
304
+ The scanner in Journey failed to recognize routes that use literals
305
+ from the sub-delims section of RFC 3986. It's now able to parse those
306
+ authorized delimiters and route as expected.
357
307
 
358
- *Rafael Mendonça França*
308
+ Fixes #17212.
359
309
 
360
- * Revert the rename of internal variable on ActionController::TemplateAssertions to prevent
361
- naming collisions. This added a regression related with shoulda-matchers, since it is
362
- expecting the [instance variable @layouts](https://github.com/thoughtbot/shoulda-matchers/blob/9e1188eea68c47d9a56ce6280e45027da6187ab1/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb#L74).
363
- This will introduce back #7459 but this stable release will be backward compatible.
364
- Fixes #8068.
310
+ *Nicolas Cavigneaux*
365
311
 
366
- *Rafael Mendonça França*
312
+ * Deprecate implicit Array conversion for Response objects. It was added
313
+ (using `#to_ary`) so we could conveniently use implicit splatting:
367
314
 
368
- * Accept :remote as symbolic option for `link_to` helper. *Riley Lynch*
315
+ status, headers, body = response
369
316
 
370
- * Warn when the `:locals` option is passed to `assert_template` outside of a view test case
371
- Fix #3415
372
-
373
- *Yves Senn*
374
-
375
- * Rename internal variables on ActionController::TemplateAssertions to prevent
376
- naming collisions. @partials, @templates and @layouts are now prefixed with an underscore.
377
- Fix #7459
378
-
379
- *Yves Senn*
317
+ But it also means `response + response` works and `[response].flatten`
318
+ cascades down to the Rack body. Nonsense behavior. Instead, rely on
319
+ explicit conversion and splatting with `#to_a`:
380
320
 
381
- * `resource` and `resources` don't modify the passed options hash
382
- Fix #7777
383
-
384
- *Yves Senn*
385
-
386
- * Precompiled assets include aliases from foo.js to foo/index.js and vice versa.
387
-
388
- # Precompiles phone-<digest>.css and aliases phone/index.css to phone.css.
389
- config.assets.precompile = [ 'phone.css' ]
390
-
391
- # Precompiles phone/index-<digest>.css and aliases phone.css to phone/index.css.
392
- config.assets.precompile = [ 'phone/index.css' ]
393
-
394
- # Both of these work with either precompile thanks to their aliases.
395
- <%= stylesheet_link_tag 'phone', media: 'all' %>
396
- <%= stylesheet_link_tag 'phone/index', media: 'all' %>
321
+ status, header, body = *response
397
322
 
398
323
  *Jeremy Kemper*
399
324
 
400
- * `assert_template` is no more passing with what ever string that matches
401
- with the template name.
402
-
403
- Before when we have a template `/layout/hello.html.erb`, `assert_template`
404
- was passing with any string that matches. This behavior allowed false
405
- positive like:
406
-
407
- assert_template "layout"
408
- assert_template "out/hello"
409
-
410
- Now it only passes with:
411
-
412
- assert_template "layout/hello"
413
- assert_template "hello"
414
-
415
- Fixes #3849.
416
-
417
- *Hugolnx*
418
-
419
- * Handle `ActionDispatch::Http::UploadedFile` like `Rack::Test::UploadedFile`, don't call to_param on it. Since
420
- `Rack::Test::UploadedFile` isn't API compatible this is needed to test file uploads that rely on `tempfile`
421
- being available.
422
-
423
- *Tim Vandecasteele*
424
-
425
- * Respect `config.digest = false` for `asset_path`
426
-
427
- Previously, the `asset_path` internals only respected the `:digest`
428
- option, but ignored the global config setting. This meant that
429
- `config.digest = false` could not be used in conjunction with
430
- `config.compile = false` this corrects the behavior.
431
-
432
- *Peter Wagenet*
433
-
434
- * Fix #7646, the log now displays the correct status code when an exception is raised.
435
-
436
- *Yves Senn*
437
-
438
- * Fix handling of date selects when using both disabled and discard options.
439
- Fixes #7431.
440
-
441
- *Vasiliy Ermolovich*
325
+ * Don't rescue `IPAddr::InvalidAddressError`.
442
326
 
443
- * Fix select_tag when option_tags is nil.
444
- Fixes #7404.
327
+ `IPAddr::InvalidAddressError` does not exist in Ruby 1.9.3
328
+ and fails for JRuby in 1.9 mode.
445
329
 
446
- *Sandeep Ravichandran*
330
+ *Peter Suschlik*
447
331
 
448
- * `javascript_include_tag :all` will now not include `application.js` if the file does not exists. *Prem Sichanugrist*
332
+ * Fix bug where the router would ignore any constraints added to redirect
333
+ routes.
449
334
 
450
- * Support cookie jar options (e.g., domain :all) for all session stores.
451
- Fixes GH#3047, GH#2483.
335
+ Fixes #16605.
452
336
 
453
- *Ravil Bayramgalin*
454
-
455
- * Performance Improvement to send_file: Avoid having to pass an open file handle as the response body. Rack::Sendfile
456
- will usually intercept the response and just uses the path directly, so no reason to open the file. This performance
457
- improvement also resolves an issue with jRuby encodings, and is the reason for the backport, see issue #6844.
458
-
459
- *Jeremy Kemper & Erich Menge*
460
-
461
-
462
- ## Rails 3.2.8 (Aug 9, 2012) ##
463
-
464
- * There is an XSS vulnerability in the strip_tags helper in Ruby on Rails, the
465
- helper doesn't correctly handle malformed html. As a result an attacker can
466
- execute arbitrary javascript through the use of specially crafted malformed
467
- html.
468
-
469
- *Marek from Nethemba (www.nethemba.com) & Santiago Pastorino*
470
-
471
- * When a "prompt" value is supplied to the `select_tag` helper, the "prompt" value is not escaped.
472
- If untrusted data is not escaped, and is supplied as the prompt value, there is a potential for XSS attacks.
473
- Vulnerable code will look something like this:
474
- select_tag("name", options, :prompt => UNTRUSTED_INPUT)
475
-
476
- *Santiago Pastorino*
477
-
478
- * Reverted the deprecation of `:confirm`. *Rafael Mendonça França*
479
-
480
- * Reverted the deprecation of `:disable_with`. *Rafael Mendonça França*
337
+ *Agis Anastasopoulos*
481
338
 
482
- * Reverted the deprecation of `:mouseover` option to `image_tag`. *Rafael Mendonça França*
483
-
484
- * Reverted the deprecation of `button_to_function` and `link_to_function` helpers.
485
-
486
- *Rafael Mendonça França*
339
+ * Allow `config.action_dispatch.trusted_proxies` to accept an IPAddr object.
487
340
 
341
+ Example:
488
342
 
489
- ## Rails 3.2.7 (Jul 26, 2012) ##
343
+ # config/environments/production.rb
344
+ config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
490
345
 
491
- * Do not convert digest auth strings to symbols. CVE-2012-3424
346
+ *Sam Aarons*
492
347
 
493
- * Bump Journey requirements to 1.0.4
348
+ * Avoid duplicating routes for HEAD requests.
494
349
 
495
- * Add support for optional root segments containing slashes
350
+ Instead of duplicating the routes, we will first match the HEAD request to
351
+ HEAD routes. If no match is found, we will then map the HEAD request to
352
+ GET routes.
496
353
 
497
- * Fixed bug creating invalid HTML in select options
354
+ *Guo Xiang Tan*, *Andrew White*
498
355
 
499
- * Show in log correct wrapped keys
356
+ * Requests that hit `ActionDispatch::Static` can now take advantage
357
+ of gzipped assets on disk. By default a gzip asset will be served if
358
+ the client supports gzip and a compressed file is on disk.
500
359
 
501
- * Fix NumberHelper options wrapping to prevent verbatim blocks being rendered instead of line continuations.
360
+ *Richard Schneeman*
502
361
 
503
- * ActionController::Metal doesn't have logger method, check it and then delegate
362
+ * `ActionController::Parameters` will stop inheriting from `Hash` and
363
+ `HashWithIndifferentAccess` in the next major release. If you use any method
364
+ that is not available on `ActionController::Parameters` you should consider
365
+ calling `#to_h` to convert it to a `Hash` first before calling that method.
504
366
 
505
- * ActionController::Caching depends on RackDelegation and AbstractController::Callbacks
367
+ *Prem Sichanugrist*
506
368
 
369
+ * `ActionController::Parameters#to_h` now returns a `Hash` with unpermitted
370
+ keys removed. This change is to reflect on a security concern where some
371
+ method performed on an `ActionController::Parameters` may yield a `Hash`
372
+ object which does not maintain `permitted?` status. If you would like to
373
+ get a `Hash` with all the keys intact, duplicate and mark it as permitted
374
+ before calling `#to_h`.
507
375
 
508
- ## Rails 3.2.6 (Jun 12, 2012) ##
376
+ params = ActionController::Parameters.new({
377
+ name: 'Senjougahara Hitagi',
378
+ oddity: 'Heavy stone crab'
379
+ })
380
+ params.to_h
381
+ # => {}
509
382
 
510
- * nil is removed from array parameter values
383
+ unsafe_params = params.dup.permit!
384
+ unsafe_params.to_h
385
+ # => {"name"=>"Senjougahara Hitagi", "oddity"=>"Heavy stone crab"}
511
386
 
512
- CVE-2012-2694
387
+ safe_params = params.permit(:name)
388
+ safe_params.to_h
389
+ # => {"name"=>"Senjougahara Hitagi"}
513
390
 
514
- * Deprecate `:confirm` in favor of `':data => { :confirm => "Text" }'` option for `button_to`, `button_tag`, `image_submit_tag`, `link_to` and `submit_tag` helpers.
391
+ This change is consider a stopgap as we cannot change the code to stop
392
+ `ActionController::Parameters` to inherit from `HashWithIndifferentAccess`
393
+ in the next minor release.
515
394
 
516
- *Carlos Galdino*
395
+ *Prem Sichanugrist*
517
396
 
518
- * Allow to use mounted_helpers (helpers for accessing mounted engines) in ActionView::TestCase. *Piotr Sarnacki*
397
+ * Deprecated `TagAssertions`.
519
398
 
520
- * Include mounted_helpers (helpers for accessing mounted engines) in ActionDispatch::IntegrationTest by default. *Piotr Sarnacki*
399
+ *Kasper Timm Hansen*
521
400
 
401
+ * Use the Active Support JSON encoder for cookie jars using the `:json` or
402
+ `:hybrid` serializer. This allows you to serialize custom Ruby objects into
403
+ cookies by defining the `#as_json` hook on such objects.
522
404
 
523
- ## Rails 3.2.5 (Jun 1, 2012) ##
405
+ Fixes #16520.
524
406
 
525
- * No changes.
407
+ *Godfrey Chan*
526
408
 
409
+ * Add `config.action_dispatch.cookies_digest` option for setting custom
410
+ digest. The default remains the same - 'SHA1'.
527
411
 
528
- ## Rails 3.2.4 (May 31, 2012) ##
412
+ *Łukasz Strzałkowski*
529
413
 
530
- * Deprecate old APIs for highlight, excerpt and word_wrap *Jeremy Walker*
414
+ * Move `respond_with` (and the class-level `respond_to`) to
415
+ the `responders` gem.
531
416
 
532
- * Deprecate `:disable_with` in favor of `'data-disable-with'` option for `button_to`, `button_tag` and `submit_tag` helpers.
417
+ *José Valim*
533
418
 
534
- *Carlos Galdino + Rafael Mendonça França*
419
+ * When your templates change, browser caches bust automatically.
535
420
 
536
- * Deprecate `:mouseover` option for `image_tag` helper. *Rafael Mendonça França*
421
+ New default: the template digest is automatically included in your ETags.
422
+ When you call `fresh_when @post`, the digest for `posts/show.html.erb`
423
+ is mixed in so future changes to the HTML will blow HTTP caches for you.
424
+ This makes it easy to HTTP-cache many more of your actions.
537
425
 
538
- * Deprecate `button_to_function` and `link_to_function` helpers. *Rafael Mendonça França*
426
+ If you render a different template, you can now pass the `:template`
427
+ option to include its digest instead:
539
428
 
540
- * Don't break Haml with textarea newline fix. GH #393, #4000, #5190, #5191
429
+ fresh_when @post, template: 'widgets/show'
541
430
 
542
- * Fix options handling on labels. GH #2492, #5614
431
+ Pass `template: false` to skip the lookup. To turn this off entirely, set:
543
432
 
544
- * Added config.action_view.embed_authenticity_token_in_remote_forms to deal
545
- with regression from 16ee611fa
433
+ config.action_controller.etag_with_template_digest = false
546
434
 
547
- * Set rendered_format when doing render :inline. GH #5632
435
+ *Jeremy Kemper*
548
436
 
549
- * Fix the redirect when it receive blocks with arity of 1. Closes #5677
437
+ * Remove deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
438
+ in favor of `AbstractController::Helpers::MissingHelperError`.
550
439
 
551
- * Strip [nil] from parameters hash. Thanks to Ben Murphy for
552
- reporting this! CVE-2012-2660
440
+ *Yves Senn*
553
441
 
442
+ * Fix `assert_template` not being able to assert that no files were rendered.
554
443
 
555
- ## Rails 3.2.3 (March 30, 2012) ##
444
+ *Guo Xiang Tan*
556
445
 
557
- * Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki*
446
+ * Extract source code for the entire exception stack trace for
447
+ better debugging and diagnosis.
558
448
 
559
- * Fix #5632, render :inline set the proper rendered format. *Santiago Pastorino*
449
+ *Ryan Dao*
560
450
 
561
- * Fix textarea rendering when using plugins like HAML. Such plugins encode the first newline character in the content. This issue was introduced in https://github.com/rails/rails/pull/5191 *James Coleman*
451
+ * Allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8
452
+ loopback address.
562
453
 
563
- * Remove the leading \n added by textarea on assert_select. *Santiago Pastorino*
454
+ *Earl St Sauver*, *Sven Riedel*
564
455
 
565
- * Add `config.action_view.embed_authenticity_token_in_remote_forms` (defaults to true) which allows to set if authenticity token will be included by default in remote forms. If you change it to false, you can still force authenticity token by passing `:authenticity_token => true` in form options *Piotr Sarnacki*
456
+ * Preserve original path in `ShowExceptions` middleware by stashing it as
457
+ `env["action_dispatch.original_path"]`
566
458
 
567
- * Do not include the authenticity token in forms where remote: true as ajax forms use the meta-tag value *DHH*
459
+ `ActionDispatch::ShowExceptions` overwrites `PATH_INFO` with the status code
460
+ for the exception defined in `ExceptionWrapper`, so the path
461
+ the user was visiting when an exception occurred was not previously
462
+ available to any custom exceptions_app. The original `PATH_INFO` is now
463
+ stashed in `env["action_dispatch.original_path"]`.
568
464
 
569
- * Turn off verbose mode of rack-cache, we still have X-Rack-Cache to
570
- check that info. Closes #5245. *Santiago Pastorino*
465
+ *Grey Baker*
571
466
 
572
- * Fix #5238, rendered_format is not set when template is not rendered. *Piotr Sarnacki*
467
+ * Use `String#bytesize` instead of `String#size` when checking for cookie
468
+ overflow.
573
469
 
574
- * Upgrade rack-cache to 1.2. *José Valim*
470
+ *Agis Anastasopoulos*
575
471
 
576
- * ActionController::SessionManagement is deprecated. *Santiago Pastorino*
472
+ * `render nothing: true` or rendering a `nil` body no longer add a single
473
+ space to the response body.
577
474
 
578
- * Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
475
+ The old behavior was added as a workaround for a bug in an early version of
476
+ Safari, where the HTTP headers are not returned correctly if the response
477
+ body has a 0-length. This is been fixed since and the workaround is no
478
+ longer necessary.
579
479
 
580
- * Add a new line after the textarea opening tag. Closes #393 *Rafael Mendonça França*
480
+ Use `render body: ' '` if the old behavior is desired.
581
481
 
582
- * Always pass a respond block from to responder. We should let the responder to decide what to do with the given overridden response block, and not short circuit it. *sikachu*
482
+ See #14883 for details.
583
483
 
584
- * Fixes layout rendering regression from 3.2.2. *José Valim*
484
+ *Godfrey Chan*
585
485
 
486
+ * Prepend a JS comment to JSONP callbacks. Addresses CVE-2014-4671
487
+ ("Rosetta Flash").
586
488
 
587
- ## Rails 3.2.2 (March 1, 2012) ##
489
+ *Greg Campbell*
588
490
 
589
- * Format lookup for partials is derived from the format in which the template is being rendered. Closes #5025 part 2 *Santiago Pastorino*
491
+ * Because URI paths may contain non US-ASCII characters we need to force
492
+ the encoding of any unescaped URIs to UTF-8 if they are US-ASCII.
493
+ This essentially replicates the functionality of the monkey patch to
494
+ URI.parser.unescape in active_support/core_ext/uri.rb.
590
495
 
591
- * Use the right format when a partial is missing. Closes #5025. *Santiago Pastorino*
496
+ Fixes #16104.
592
497
 
593
- * Default responder will now always use your overridden block in `respond_with` to render your response. *Prem Sichanugrist*
498
+ *Karl Entwistle*
594
499
 
595
- * check_box helper with :disabled => true will generate a disabled hidden field to conform with the HTML convention where disabled fields are not submitted with the form.
596
- This is a behavior change, previously the hidden tag had a value of the disabled checkbox.
597
- *Tadas Tamosauskas*
500
+ * Generate shallow paths for all children of shallow resources.
598
501
 
502
+ Fixes #15783.
599
503
 
600
- ## Rails 3.2.1 (January 26, 2012) ##
504
+ *Seb Jacobs*
601
505
 
602
- * Documentation improvements.
506
+ * JSONP responses are now rendered with the `text/javascript` content type
507
+ when rendering through a `respond_to` block.
603
508
 
604
- * Allow `form.select` to accept ranges (regression). *Jeremy Walker*
509
+ Fixes #15081.
605
510
 
606
- * `datetime_select` works with -/+ infinity dates. *Joe Van Dyk*
511
+ *Lucas Mazza*
607
512
 
513
+ * Add `config.action_controller.always_permitted_parameters` to configure which
514
+ parameters are permitted globally. The default value of this configuration is
515
+ `['controller', 'action']`.
608
516
 
609
- ## Rails 3.2.0 (January 20, 2012) ##
517
+ *Gary S. Weaver*, *Rafael Chacon*
610
518
 
611
- * Setting config.assets.logger to false turn off Sprockets logger *Guillermo Iguaran*
519
+ * Fix env['PATH_INFO'] missing leading slash when a rack app mounted at '/'.
612
520
 
613
- * Add `config.action_dispatch.default_charset` to configure default charset for ActionDispatch::Response. *Carlos Antonio da Silva*
521
+ Fixes #15511.
614
522
 
615
- * Deprecate setting default charset at controller level, use the new `config.action_dispatch.default_charset` instead. *Carlos Antonio da Silva*
523
+ *Larry Lv*
616
524
 
617
- * Deprecate ActionController::UnknownAction in favour of AbstractController::ActionNotFound. *Carlos Antonio da Silva*
525
+ * ActionController::Parameters#require now accepts `false` values.
618
526
 
619
- * Deprecate ActionController::DoubleRenderError in favour of AbstractController::DoubleRenderError. *Carlos Antonio da Silva*
527
+ Fixes #15685.
620
528
 
621
- * Deprecate method_missing handling for not found actions, use action_missing instead. *Carlos Antonio da Silva*
529
+ *Sergio Romano*
622
530
 
623
- * Deprecate ActionController#rescue_action, ActionController#initialize_template_class, and ActionController#assign_shortcuts.
624
- These methods were not being used internally anymore and are going to be removed in Rails 4. *Carlos Antonio da Silva*
531
+ * With authorization header `Authorization: Token token=`, `authenticate` now
532
+ recognize token as nil, instead of "token".
625
533
 
626
- * Add config.assets.logger to configure Sprockets logger *Rafael França*
534
+ Fixes #14846.
627
535
 
628
- * Use a BodyProxy instead of including a Module that responds to
629
- close. Closes #4441 if Active Record is disabled assets are delivered
630
- correctly *Santiago Pastorino*
536
+ *Larry Lv*
631
537
 
632
- * Rails initialization with initialize_on_precompile = false should set assets_dir *Santiago Pastorino*
538
+ * Ensure the controller is always notified as soon as the client disconnects
539
+ during live streaming, even when the controller is blocked on a write.
633
540
 
634
- * Add font_path helper method *Santiago Pastorino*
541
+ *Nicholas Jakobsen*, *Matthew Draper*
635
542
 
636
- * Depends on rack ~> 1.4.0 *Santiago Pastorino*
543
+ * Routes specifying 'to:' must be a string that contains a "#" or a rack
544
+ application. Use of a symbol should be replaced with `action: symbol`.
545
+ Use of a string without a "#" should be replaced with `controller: string`.
637
546
 
638
- * Add :gzip option to `caches_page`. The default option can be configured globally using `page_cache_compression` *Andrey Sitnik*
547
+ *Aaron Patterson*
639
548
 
640
- * The ShowExceptions middleware now accepts a exceptions application that is responsible to render an exception when the application fails. The application is invoked with a copy of the exception in `env["action_dispatch.exception"]` and with the PATH_INFO rewritten to the status code. *José Valim*
549
+ * Fix URL generation with `:trailing_slash` such that it does not add
550
+ a trailing slash after `.:format`
641
551
 
642
- * Add `button_tag` support to ActionView::Helpers::FormBuilder.
552
+ *Dan Langevin*
643
553
 
644
- This support mimics the default behavior of `submit_tag`.
554
+ * Build full URI as string when processing path in integration tests for
555
+ performance reasons. One consequence of this is that the leading slash
556
+ is now required in integration test `process` helpers, whereas previously
557
+ it could be omitted. The fact that this worked was a unintended consequence
558
+ of the implementation and was never an intentional feature.
645
559
 
646
- Example:
560
+ *Guo Xiang Tan*
647
561
 
648
- <%= form_for @post do |f| %>
649
- <%= f.button %>
650
- <% end %>
562
+ * Fix `'Stack level too deep'` when rendering `head :ok` in an action method
563
+ called 'status' in a controller.
651
564
 
652
- * Date helpers accept a new option, `:use_two_digit_numbers = true`, that renders select boxes for months and days with a leading zero without changing the respective values.
653
- For example, this is useful for displaying ISO8601-style dates such as '2011-08-01'. *Lennart Fridén and Kim Persson*
565
+ Fixes #13905.
654
566
 
655
- * Make ActiveSupport::Benchmarkable a default module for ActionController::Base, so the #benchmark method is once again available in the controller context like it used to be *DHH*
567
+ *Christiaan Van den Poel*
656
568
 
657
- * Deprecated implied layout lookup in controllers whose parent had a explicit layout set:
569
+ * Add MKCALENDAR HTTP method (RFC 4791).
658
570
 
659
- class ApplicationController
660
- layout "application"
661
- end
571
+ *Sergey Karpesh*
662
572
 
663
- class PostsController < ApplicationController
664
- end
573
+ * Instrument fragment cache metrics.
665
574
 
666
- In the example above, Posts controller will no longer automatically look up for a posts layout.
575
+ Adds `:controller`: and `:action` keys to the instrumentation payload
576
+ for the `*_fragment.action_controller` notifications. This allows tracking
577
+ e.g. the fragment cache hit rates for each controller action.
667
578
 
668
- If you need this functionality you could either remove `layout "application"` from ApplicationController or explicitly set it to nil in PostsController. *José Valim*
579
+ *Daniel Schierbeck*
669
580
 
670
- * Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail. *Prem Sichanugrist*
581
+ * Always use the provided port if the protocol is relative.
671
582
 
672
- For example, consider this snippet:
583
+ Fixes #15043.
673
584
 
674
- class CarsController
675
- layout 'single_car', :only => :show
676
- end
585
+ *Guilherme Cavalcanti*, *Andrew White*
677
586
 
678
- Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
587
+ * Moved `params[request_forgery_protection_token]` into its own method
588
+ and improved tests.
679
589
 
680
- * form_for with +:as+ option uses "#{action}_#{as}" as css class and id:
590
+ Fixes #11316.
681
591
 
682
- Before:
592
+ *Tom Kadwill*
683
593
 
684
- form_for(@user, :as => 'client') # => "<form class="client_new">..."
594
+ * Added verification of route constraints given as a Proc or an object responding
595
+ to `:matches?`. Previously, when given an non-complying object, it would just
596
+ silently fail to enforce the constraint. It will now raise an `ArgumentError`
597
+ when setting up the routes.
685
598
 
686
- Now:
599
+ *Xavier Defrang*
687
600
 
688
- form_for(@user, :as => 'client') # => "<form class="new_client">..."
601
+ * Properly treat the entire IPv6 User Local Address space as private for
602
+ purposes of remote IP detection. Also handle uppercase private IPv6
603
+ addresses.
689
604
 
690
- *Vasiliy Ermolovich*
605
+ Fixes #12638.
691
606
 
692
- * Allow rescue responses to be configured through a railtie as in `config.action_dispatch.rescue_responses`. Please look at ActiveRecord::Railtie for an example *José Valim*
607
+ *Caleb Spare*
693
608
 
694
- * Allow fresh_when/stale? to take a record instead of an options hash *DHH*
609
+ * Fixed an issue with migrating legacy json cookies.
695
610
 
696
- * Assets should use the request protocol by default or default to relative if no request is available *Jonathan del Strother*
611
+ Previously, the `VerifyAndUpgradeLegacySignedMessage` assumes all incoming
612
+ cookies are marshal-encoded. This is not the case when `secret_token` is
613
+ used in conjunction with the `:json` or `:hybrid` serializer.
697
614
 
698
- * Log "Filter chain halted as CALLBACKNAME rendered or redirected" every time a before callback halts *José Valim*
615
+ In those case, when upgrading to use `secret_key_base`, this would cause a
616
+ `TypeError: incompatible marshal file format` and a 500 error for the user.
699
617
 
700
- * You can provide a namespace for your form to ensure uniqueness of id attributes on form elements.
701
- The namespace attribute will be prefixed with underscore on the generate HTML id. *Vasiliy Ermolovich*
618
+ Fixes #14774.
702
619
 
703
- Example:
620
+ *Godfrey Chan*
704
621
 
705
- <%= form_for(@offer, :namespace => 'namespace') do |f| %>
706
- <%= f.label :version, 'Version' %>:
707
- <%= f.text_field :version %>
708
- <% end %>
622
+ * Make URL escaping more consistent:
709
623
 
710
- * Refactor ActionDispatch::ShowExceptions. The controller is responsible for choosing to show exceptions when `consider_all_requests_local` is false.
624
+ 1. Escape '%' characters in URLs - only unescaped data should be passed to URL helpers
625
+ 2. Add an `escape_segment` helper to `Router::Utils` that escapes '/' characters
626
+ 3. Use `escape_segment` rather than `escape_fragment` in optimized URL generation
627
+ 4. Use `escape_segment` rather than `escape_path` in URL generation
711
628
 
712
- It's possible to override `show_detailed_exceptions?` in controllers to specify which requests should provide debugging information on errors. The default value is now false, meaning local requests in production will no longer show the detailed exceptions page unless `show_detailed_exceptions?` is overridden and set to `request.local?`.
629
+ For point 4 there are two exceptions. Firstly, when a route uses wildcard segments
630
+ (e.g. `*foo`) then we use `escape_path` as the value may contain '/' characters. This
631
+ means that wildcard routes can't be optimized. Secondly, if a `:controller` segment
632
+ is used in the path then this uses `escape_path` as the controller may be namespaced.
713
633
 
714
- * Responders now return 204 No Content for API requests without a response body (as in the new scaffold) *José Valim*
634
+ Fixes #14629, #14636 and #14070.
715
635
 
716
- * Added ActionDispatch::RequestId middleware that'll make a unique X-Request-Id header available to the response and enables the ActionDispatch::Request#uuid method. This makes it easy to trace requests from end-to-end in the stack and to identify individual requests in mixed logs like Syslog *DHH*
636
+ *Andrew White*, *Edho Arief*
717
637
 
718
- * Limit the number of options for select_year to 1000.
638
+ * Add alias `ActionDispatch::Http::UploadedFile#to_io` to
639
+ `ActionDispatch::Http::UploadedFile#tempfile`.
719
640
 
720
- Pass the :max_years_allowed option to set your own limit.
641
+ *Tim Linquist*
721
642
 
722
- *Libo Cannici*
643
+ * Returns null type format when format is not know and controller is using `any`
644
+ format block.
723
645
 
724
- * Passing formats or handlers to render :template and friends is deprecated. For example: *Nick Sutterer & José Valim*
646
+ Fixes #14462.
725
647
 
726
- render :template => "foo.html.erb"
648
+ *Rafael Mendonça França*
727
649
 
728
- Instead, you can provide :handlers and :formats directly as option:
729
- render :template => "foo", :formats => [:html, :js], :handlers => :erb
650
+ * Improve routing error page with fuzzy matching search.
730
651
 
731
- * Changed log level of warning for missing CSRF token from :debug to :warn. *Mike Dillon*
652
+ *Winston*
732
653
 
733
- * content_tag_for and div_for can now take the collection of records. It will also yield the record as the first argument if you set a receiving argument in your block *Prem Sichanugrist*
654
+ * Only make deeply nested routes shallow when parent is shallow.
734
655
 
735
- So instead of having to do this:
656
+ Fixes #14684.
736
657
 
737
- @items.each do |item|
738
- content_tag_for(:li, item) do
739
- Title: <%= item.title %>
740
- end
741
- end
658
+ *Andrew White*, *James Coglan*
742
659
 
743
- You can now do this:
660
+ * Append link to bad code to backtrace when exception is `SyntaxError`.
744
661
 
745
- content_tag_for(:li, @items) do |item|
746
- Title: <%= item.title %>
747
- end
662
+ *Boris Kuznetsov*
748
663
 
749
- * send_file now guess the mime type *Esad Hajdarevic*
664
+ * Swapped the parameters of assert_equal in `assert_select` so that the
665
+ proper values were printed correctly.
750
666
 
751
- * Mime type entries for PDF, ZIP and other formats were added *Esad Hajdarevic*
667
+ Fixes #14422.
752
668
 
753
- * Generate hidden input before select with :multiple option set to true.
754
- This is useful when you rely on the fact that when no options is set,
755
- the state of select will be sent to rails application. Without hidden field
756
- nothing is sent according to HTML spec *Bogdan Gusiev*
669
+ *Vishal Lal*
757
670
 
758
- * Refactor ActionController::TestCase cookies *Andrew White*
671
+ * The method `shallow?` returns false if the parent resource is a singleton so
672
+ we need to check if we're not inside a nested scope before copying the :path
673
+ and :as options to their shallow equivalents.
759
674
 
760
- Assigning cookies for test cases should now use cookies[], e.g:
675
+ Fixes #14388.
761
676
 
762
- cookies[:email] = 'user@example.com'
763
- get :index
764
- assert_equal 'user@example.com', cookies[:email]
677
+ *Andrew White*
765
678
 
766
- To clear the cookies, use clear, e.g:
679
+ * Make logging of CSRF failures optional (but on by default) with the
680
+ `log_warning_on_csrf_failure` configuration setting in
681
+ `ActionController::RequestForgeryProtection`.
767
682
 
768
- cookies.clear
769
- get :index
770
- assert_nil cookies[:email]
683
+ *John Barton*
771
684
 
772
- We now no longer write out HTTP_COOKIE and the cookie jar is
773
- persistent between requests so if you need to manipulate the environment
774
- for your test you need to do it before the cookie jar is created.
685
+ * Fix URL generation in controller tests with request-dependent
686
+ `default_url_options` methods.
775
687
 
776
- * ActionController::ParamsWrapper on ActiveRecord models now only wrap
777
- attr_accessible attributes if they were set, if not, only the attributes
778
- returned by the class method attribute_names will be wrapped. This fixes
779
- the wrapping of nested attributes by adding them to attr_accessible.
688
+ *Tony Wooster*
780
689
 
781
- Please check [3-1-stable](https://github.com/rails/rails/blob/3-1-stable/actionpack/CHANGELOG.md) for previous changes.
690
+ Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md) for previous changes.