actionpack 5.1.7 → 5.2.0.beta1

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 (144) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +132 -490
  3. data/README.rdoc +1 -1
  4. data/lib/abstract_controller.rb +2 -0
  5. data/lib/abstract_controller/asset_paths.rb +2 -0
  6. data/lib/abstract_controller/base.rb +10 -2
  7. data/lib/abstract_controller/caching.rb +3 -2
  8. data/lib/abstract_controller/caching/fragments.rb +30 -7
  9. data/lib/abstract_controller/callbacks.rb +25 -3
  10. data/lib/abstract_controller/collector.rb +2 -0
  11. data/lib/abstract_controller/error.rb +2 -0
  12. data/lib/abstract_controller/helpers.rb +4 -5
  13. data/lib/abstract_controller/logger.rb +2 -0
  14. data/lib/abstract_controller/railties/routes_helpers.rb +2 -0
  15. data/lib/abstract_controller/rendering.rb +9 -16
  16. data/lib/abstract_controller/translation.rb +2 -0
  17. data/lib/abstract_controller/url_for.rb +2 -0
  18. data/lib/action_controller.rb +3 -0
  19. data/lib/action_controller/api.rb +2 -0
  20. data/lib/action_controller/api/api_rendering.rb +2 -0
  21. data/lib/action_controller/base.rb +3 -0
  22. data/lib/action_controller/caching.rb +2 -0
  23. data/lib/action_controller/form_builder.rb +2 -0
  24. data/lib/action_controller/log_subscriber.rb +5 -3
  25. data/lib/action_controller/metal.rb +3 -2
  26. data/lib/action_controller/metal/basic_implicit_render.rb +2 -0
  27. data/lib/action_controller/metal/conditional_get.rb +4 -3
  28. data/lib/action_controller/metal/content_security_policy.rb +26 -0
  29. data/lib/action_controller/metal/cookies.rb +2 -0
  30. data/lib/action_controller/metal/data_streaming.rb +7 -5
  31. data/lib/action_controller/metal/etag_with_flash.rb +2 -0
  32. data/lib/action_controller/metal/etag_with_template_digest.rb +3 -2
  33. data/lib/action_controller/metal/exceptions.rb +2 -3
  34. data/lib/action_controller/metal/flash.rb +3 -2
  35. data/lib/action_controller/metal/force_ssl.rb +2 -0
  36. data/lib/action_controller/metal/head.rb +2 -0
  37. data/lib/action_controller/metal/helpers.rb +4 -3
  38. data/lib/action_controller/metal/http_authentication.rb +8 -9
  39. data/lib/action_controller/metal/implicit_render.rb +2 -0
  40. data/lib/action_controller/metal/instrumentation.rb +4 -6
  41. data/lib/action_controller/metal/live.rb +3 -1
  42. data/lib/action_controller/metal/mime_responds.rb +3 -1
  43. data/lib/action_controller/metal/parameter_encoding.rb +2 -0
  44. data/lib/action_controller/metal/params_wrapper.rb +13 -9
  45. data/lib/action_controller/metal/redirecting.rb +21 -10
  46. data/lib/action_controller/metal/renderers.rb +4 -3
  47. data/lib/action_controller/metal/rendering.rb +2 -2
  48. data/lib/action_controller/metal/request_forgery_protection.rb +22 -6
  49. data/lib/action_controller/metal/rescue.rb +5 -3
  50. data/lib/action_controller/metal/streaming.rb +2 -0
  51. data/lib/action_controller/metal/strong_parameters.rb +19 -11
  52. data/lib/action_controller/metal/testing.rb +2 -6
  53. data/lib/action_controller/metal/url_for.rb +2 -0
  54. data/lib/action_controller/railtie.rb +16 -4
  55. data/lib/action_controller/railties/helpers.rb +2 -0
  56. data/lib/action_controller/renderer.rb +2 -0
  57. data/lib/action_controller/template_assertions.rb +2 -0
  58. data/lib/action_controller/test_case.rb +4 -1
  59. data/lib/action_dispatch.rb +3 -0
  60. data/lib/action_dispatch/http/cache.rb +15 -9
  61. data/lib/action_dispatch/http/content_security_policy.rb +233 -0
  62. data/lib/action_dispatch/http/filter_parameters.rb +4 -2
  63. data/lib/action_dispatch/http/filter_redirect.rb +2 -0
  64. data/lib/action_dispatch/http/headers.rb +2 -0
  65. data/lib/action_dispatch/http/mime_negotiation.rb +4 -13
  66. data/lib/action_dispatch/http/mime_type.rb +15 -13
  67. data/lib/action_dispatch/http/mime_types.rb +4 -2
  68. data/lib/action_dispatch/http/parameter_filter.rb +2 -0
  69. data/lib/action_dispatch/http/parameters.rb +6 -9
  70. data/lib/action_dispatch/http/rack_cache.rb +2 -0
  71. data/lib/action_dispatch/http/request.rb +36 -16
  72. data/lib/action_dispatch/http/response.rb +11 -9
  73. data/lib/action_dispatch/http/upload.rb +2 -0
  74. data/lib/action_dispatch/http/url.rb +4 -5
  75. data/lib/action_dispatch/journey.rb +2 -0
  76. data/lib/action_dispatch/journey/formatter.rb +4 -2
  77. data/lib/action_dispatch/journey/gtg/builder.rb +2 -0
  78. data/lib/action_dispatch/journey/gtg/simulator.rb +2 -8
  79. data/lib/action_dispatch/journey/gtg/transition_table.rb +3 -2
  80. data/lib/action_dispatch/journey/nfa/builder.rb +2 -0
  81. data/lib/action_dispatch/journey/nfa/dot.rb +2 -0
  82. data/lib/action_dispatch/journey/nfa/simulator.rb +2 -0
  83. data/lib/action_dispatch/journey/nfa/transition_table.rb +2 -0
  84. data/lib/action_dispatch/journey/nodes/node.rb +2 -0
  85. data/lib/action_dispatch/journey/parser_extras.rb +2 -0
  86. data/lib/action_dispatch/journey/path/pattern.rb +2 -0
  87. data/lib/action_dispatch/journey/route.rb +15 -6
  88. data/lib/action_dispatch/journey/router.rb +3 -1
  89. data/lib/action_dispatch/journey/router/utils.rb +14 -7
  90. data/lib/action_dispatch/journey/routes.rb +2 -1
  91. data/lib/action_dispatch/journey/scanner.rb +1 -0
  92. data/lib/action_dispatch/journey/visitors.rb +5 -3
  93. data/lib/action_dispatch/middleware/callbacks.rb +2 -0
  94. data/lib/action_dispatch/middleware/cookies.rb +141 -91
  95. data/lib/action_dispatch/middleware/debug_exceptions.rb +4 -2
  96. data/lib/action_dispatch/middleware/debug_locks.rb +9 -7
  97. data/lib/action_dispatch/middleware/exception_wrapper.rb +4 -6
  98. data/lib/action_dispatch/middleware/executor.rb +2 -0
  99. data/lib/action_dispatch/middleware/flash.rb +3 -1
  100. data/lib/action_dispatch/middleware/public_exceptions.rb +6 -4
  101. data/lib/action_dispatch/middleware/reloader.rb +2 -0
  102. data/lib/action_dispatch/middleware/remote_ip.rb +7 -5
  103. data/lib/action_dispatch/middleware/request_id.rb +2 -0
  104. data/lib/action_dispatch/middleware/session/abstract_store.rb +3 -1
  105. data/lib/action_dispatch/middleware/session/cache_store.rb +2 -0
  106. data/lib/action_dispatch/middleware/session/cookie_store.rb +13 -25
  107. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +2 -0
  108. data/lib/action_dispatch/middleware/show_exceptions.rb +3 -1
  109. data/lib/action_dispatch/middleware/ssl.rb +42 -37
  110. data/lib/action_dispatch/middleware/stack.rb +2 -0
  111. data/lib/action_dispatch/middleware/static.rb +10 -8
  112. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +1 -0
  113. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +6 -2
  114. data/lib/action_dispatch/railtie.rb +7 -0
  115. data/lib/action_dispatch/request/session.rb +8 -4
  116. data/lib/action_dispatch/request/utils.rb +4 -4
  117. data/lib/action_dispatch/routing.rb +3 -1
  118. data/lib/action_dispatch/routing/endpoint.rb +8 -4
  119. data/lib/action_dispatch/routing/inspector.rb +5 -3
  120. data/lib/action_dispatch/routing/mapper.rb +62 -51
  121. data/lib/action_dispatch/routing/polymorphic_routes.rb +2 -0
  122. data/lib/action_dispatch/routing/redirection.rb +7 -5
  123. data/lib/action_dispatch/routing/route_set.rb +26 -33
  124. data/lib/action_dispatch/routing/routes_proxy.rb +5 -2
  125. data/lib/action_dispatch/routing/url_for.rb +6 -4
  126. data/lib/action_dispatch/system_test_case.rb +14 -6
  127. data/lib/action_dispatch/system_testing/driver.rb +20 -2
  128. data/lib/action_dispatch/system_testing/server.rb +2 -16
  129. data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +6 -4
  130. data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +2 -0
  131. data/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +26 -0
  132. data/lib/action_dispatch/testing/assertion_response.rb +2 -0
  133. data/lib/action_dispatch/testing/assertions.rb +2 -0
  134. data/lib/action_dispatch/testing/assertions/response.rb +4 -2
  135. data/lib/action_dispatch/testing/assertions/routing.rb +5 -5
  136. data/lib/action_dispatch/testing/integration.rb +24 -21
  137. data/lib/action_dispatch/testing/request_encoder.rb +2 -0
  138. data/lib/action_dispatch/testing/test_process.rb +2 -0
  139. data/lib/action_dispatch/testing/test_request.rb +3 -1
  140. data/lib/action_dispatch/testing/test_response.rb +23 -3
  141. data/lib/action_pack.rb +2 -0
  142. data/lib/action_pack/gem_version.rb +5 -3
  143. data/lib/action_pack/version.rb +2 -0
  144. metadata +17 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: b74291670f1ba9c12fe411448739a7435744e7594005819f11ff447a0db28e26
4
- data.tar.gz: ac53ac07f2a25fe3a212acbe4717d55e2fe361267648820ecd72ede6e0167245
2
+ SHA1:
3
+ metadata.gz: 3821f4323c39965ff764dbf966834e13c75b853c
4
+ data.tar.gz: 2d8cc8b821ddd606cf856288b702f7605f0bdbc2
5
5
  SHA512:
6
- metadata.gz: 8cd67c197cff3ae4c31e9e64c4d24a7b05dfbce7b0c289122554e7a60eb38256cf6ea85bd2d49092dfed2c6fc4aa32cd0bf93ab6fdc81388e6d40d25348fba5f
7
- data.tar.gz: d005d7a4ea15138642967820d6c585d1eedf169d06012ea19f6cab2810e5ac21d62d938e633724a916570ab7804b8f7315874bdf4fa696128968240ec77917d9
6
+ metadata.gz: a1fcd84c325af712a75a7041f4614c1ee7e13b6f82f6f88a498f2cc085dc92b7a7af1195d73d2c0faaf46eb7500a39c8d3e206b5acce29267eec29741bf9e7dc
7
+ data.tar.gz: 3a90e34a9403fdaba1fb2d4b8a25f8412043f65f5015ffe30b3515a4adfc4d9aed6824eb9568f5b81b35aed016380d2b42b9ba5f070fa43e01f58bdee388af93
@@ -1,134 +1,189 @@
1
- ## Rails 5.1.7 (March 27, 2019) ##
2
-
3
- * No changes.
1
+ ## Rails 5.2.0.beta1 (November 27, 2017) ##
2
+
3
+ * Add DSL for configuring Content-Security-Policy header
4
+
5
+ The DSL allows you to configure a global Content-Security-Policy
6
+ header and then override within a controller. For more information
7
+ about the Content-Security-Policy header see MDN:
8
+
9
+ https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
10
+
11
+ Example global policy:
12
+
13
+ # config/initializers/content_security_policy.rb
14
+ Rails.application.config.content_security_policy do |p|
15
+ p.default_src :self, :https
16
+ p.font_src :self, :https, :data
17
+ p.img_src :self, :https, :data
18
+ p.object_src :none
19
+ p.script_src :self, :https
20
+ p.style_src :self, :https, :unsafe_inline
21
+ end
22
+
23
+ Example controller overrides:
24
+
25
+ # Override policy inline
26
+ class PostsController < ApplicationController
27
+ content_security_policy do |p|
28
+ p.upgrade_insecure_requests true
29
+ end
30
+ end
31
+
32
+ # Using literal values
33
+ class PostsController < ApplicationController
34
+ content_security_policy do |p|
35
+ p.base_uri "https://www.example.com"
36
+ end
37
+ end
38
+
39
+ # Using mixed static and dynamic values
40
+ class PostsController < ApplicationController
41
+ content_security_policy do |p|
42
+ p.base_uri :self, -> { "https://#{current_user.domain}.example.com" }
43
+ end
44
+ end
45
+
46
+ Allows you to also only report content violations for migrating
47
+ legacy content using the `content_security_policy_report_only`
48
+ configuration attribute, e.g;
49
+
50
+ # config/initializers/content_security_policy.rb
51
+ Rails.application.config.content_security_policy_report_only = true
52
+
53
+ # controller override
54
+ class PostsController < ApplicationController
55
+ self.content_security_policy_report_only = true
56
+ end
57
+
58
+ Note that this feature does not validate the header for performance
59
+ reasons since the header is calculated at runtime.
4
60
 
61
+ *Andrew White*
5
62
 
6
- ## Rails 5.1.6.2 (March 11, 2019) ##
63
+ * Make `assert_recognizes` to traverse mounted engines
7
64
 
8
- * No changes.
65
+ *Yuichiro Kaneko*
9
66
 
67
+ * Remove deprecated `ActionController::ParamsParser::ParseError`.
10
68
 
11
- ## Rails 5.1.6.1 (November 27, 2018) ##
69
+ *Rafael Mendonça França*
12
70
 
13
- * No changes.
71
+ * Add `:allow_other_host` option to `redirect_back` method.
72
+ When `allow_other_host` is set to `false`, the `redirect_back`
73
+ will not allow a redirecting from a different host.
74
+ `allow_other_host` is `true` by default.
14
75
 
76
+ *Tim Masliuchenko*
15
77
 
16
- ## Rails 5.1.6 (March 29, 2018) ##
78
+ * Add headless chrome support to System Tests.
17
79
 
18
- * Check exclude before flagging cookies as secure.
80
+ *Yuji Yaginuma*
19
81
 
20
- *Catherine Khuu*
82
+ * Add ability to enable Early Hints for HTTP/2
21
83
 
84
+ If supported by the server, and enabled in Puma this allows H2 Early Hints to be used.
22
85
 
23
- ## Rails 5.1.5 (February 14, 2018) ##
86
+ The `javascript_include_tag` and the `stylesheet_link_tag` automatically add Early Hints if requested.
24
87
 
25
- * Fix optimized url helpers when using relative url root
88
+ *Eileen M. Uchitelle*, *Aaron Patterson*
26
89
 
27
- Fixes #31220.
90
+ * Simplify cookies middleware with key rotation support
28
91
 
29
- *Andrew White*
92
+ Use the `rotate` method for both `MessageEncryptor` and
93
+ `MessageVerifier` to add key rotation support for encrypted and
94
+ signed cookies. This also helps simplify support for legacy cookie
95
+ security.
30
96
 
31
- * Ensure dev and prod puma configs do not clobber `ActionDispatch::SystemTesting` defaults. Adds workers: 0 and daemon: false
97
+ *Michael J Coyne*
32
98
 
33
- *Max Schwenk*
99
+ * Use Capybara registered `:puma` server config.
34
100
 
35
- ## Rails 5.1.4 (September 07, 2017) ##
101
+ The Capybara registered `:puma` server ensures the puma server is run in process so
102
+ connection sharing and open request detection work correctly by default.
36
103
 
37
- * Make `take_failed_screenshot` work within engine.
104
+ *Thomas Walpole*
38
105
 
39
- Fixes #30405.
106
+ * Cookies `:expires` option supports `ActiveSupport::Duration` object.
40
107
 
41
- *Yuji Yaginuma*
108
+ cookies[:user_name] = { value: "assain", expires: 1.hour }
109
+ cookies[:key] = { value: "a yummy cookie", expires: 6.months }
42
110
 
43
- ## Rails 5.1.4.rc1 (August 24, 2017) ##
111
+ Pull Request: #30121
44
112
 
45
- * No changes.
113
+ *Assain Jaleel*
46
114
 
115
+ * Enforce signed/encrypted cookie expiry server side.
47
116
 
48
- ## Rails 5.1.3 (August 03, 2017) ##
117
+ Rails can thwart attacks by malicious clients that don't honor a cookie's expiry.
49
118
 
50
- * No changes.
119
+ It does so by stashing the expiry within the written cookie and relying on the
120
+ signing/encrypting to vouch that it hasn't been tampered with. Then on a
121
+ server-side read, the expiry is verified and any expired cookie is discarded.
51
122
 
123
+ Pull Request: #30121
52
124
 
53
- ## Rails 5.1.3.rc3 (July 31, 2017) ##
125
+ *Assain Jaleel*
54
126
 
55
- * No changes.
127
+ * Make `take_failed_screenshot` work within engine.
56
128
 
129
+ Fixes #30405.
57
130
 
58
- ## Rails 5.1.3.rc2 (July 25, 2017) ##
131
+ *Yuji Yaginuma*
59
132
 
60
- * No changes.
133
+ * Deprecate `ActionDispatch::TestResponse` response aliases
61
134
 
135
+ `#success?`, `#missing?` & `#error?` are not supported by the actual
136
+ `ActionDispatch::Response` object and can produce false-positives. Instead,
137
+ use the response helpers provided by `Rack::Response`.
62
138
 
63
- ## Rails 5.1.3.rc1 (July 19, 2017) ##
139
+ *Trevor Wistaff*
64
140
 
65
- * No changes.
141
+ * Protect from forgery by default
66
142
 
143
+ Rather than protecting from forgery in the generated `ApplicationController`,
144
+ add it to `ActionController::Base` depending on
145
+ `config.action_controller.default_protect_from_forgery`. This configuration
146
+ defaults to false to support older versions which have removed it from their
147
+ `ApplicationController`, but is set to true for Rails 5.2.
67
148
 
68
- ## Rails 5.1.2 (June 26, 2017) ##
149
+ *Lisa Ugray*
69
150
 
70
151
  * Fallback `ActionController::Parameters#to_s` to `Hash#to_s`.
71
152
 
72
153
  *Kir Shatrov*
73
154
 
74
- * `driven_by` now registers poltergeist and capybara-webkit
155
+ * `driven_by` now registers poltergeist and capybara-webkit.
75
156
 
76
- If driver poltergeist or capybara-webkit is set for System Tests,
157
+ If poltergeist or capybara-webkit are set as drivers is set for System Tests,
77
158
  `driven_by` will register the driver and set additional options passed via
78
- `:options` param.
159
+ the `:options` parameter.
79
160
 
80
- Refer to drivers documentation to learn what options can be passed.
161
+ Refer to the respective driver's documentation to see what options can be passed.
81
162
 
82
163
  *Mario Chavez*
83
164
 
84
- ## Rails 5.1.1 (May 12, 2017) ##
85
-
86
- * No changes.
165
+ * AEAD encrypted cookies and sessions with GCM.
87
166
 
167
+ Encrypted cookies now use AES-GCM which couples authentication and
168
+ encryption in one faster step and produces shorter ciphertexts. Cookies
169
+ encrypted using AES in CBC HMAC mode will be seamlessly upgraded when
170
+ this new mode is enabled via the
171
+ `action_dispatch.use_authenticated_cookie_encryption` configuration value.
88
172
 
89
- ## Rails 5.1.0 (April 27, 2017) ##
173
+ *Michael J Coyne*
90
174
 
91
- * Raise exception when calling `to_h` and `to_hash` in an unpermitted Parameters.
175
+ * Change the cache key format for fragments to make it easier to debug key churn. The new format is:
92
176
 
93
- Before we returned either an empty hash or only the always permitted parameters
94
- (`:controller` and `:action` by default).
95
-
96
- The previous behavior was dangerous because in order to get the attributes users
97
- usually fallback to use `to_unsafe_h that` could potentially introduce security issues.
98
-
99
- *Rafael Mendonça França*
177
+ views/template/action.html.erb:7a1156131a6928cb0026877f8b749ac9/projects/123
178
+ ^template path ^template tree digest ^class ^id
100
179
 
101
- * Deprecate `config.action_controller.raise_on_unfiltered_parameters`.
102
-
103
- This option has no effect in Rails 5.1.
104
-
105
- *Rafael Mendonça França*
106
-
107
- * Use more specific check for :format in route path
108
-
109
- The current check for whether to add an optional format to the path is very lax
110
- and will match things like `:format_id` where there are nested resources, e.g:
111
-
112
- ``` ruby
113
- resources :formats do
114
- resources :items
115
- end
116
- ```
117
-
118
- Fix this by using a more restrictive regex pattern that looks for the patterns
119
- `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
120
- allow for multiple closing parenthesis since the route may be of this form:
121
-
122
- ``` ruby
123
- get "/books(/:action(.:format))", controller: "books"
124
- ```
125
-
126
- This probably isn't what's intended since it means that the default index action
127
- route doesn't support a format but we have a test for it so we need to allow it.
180
+ *DHH*
128
181
 
129
- Fixes #28517.
182
+ * Add support for recyclable cache keys with fragment caching. This uses the new versioned entries in the
183
+ `ActiveSupport::Cache` stores and relies on the fact that Active Record has split `#cache_key` and `#cache_version`
184
+ to support it.
130
185
 
131
- *Andrew White*
186
+ *DHH*
132
187
 
133
188
  * Add `action_controller_api` and `action_controller_base` load hooks to be called in `ActiveSupport.on_load`
134
189
 
@@ -142,418 +197,5 @@
142
197
 
143
198
  *Julian Nadeau*
144
199
 
145
- * Don't include default headers in `ActionController::Metal` responses
146
-
147
- The commit e16afe6 introduced an unintentional change of behavior where the default
148
- headers were included in responses from `ActionController::Metal` based controllers.
149
- This is now reverted to the previous behavior of having no default headers.
150
-
151
- Fixes #25820.
152
-
153
- *Jon Moss*
154
-
155
- * Fix `NameError` raised in `ActionController::Renderer#with_defaults`
156
-
157
- *Hiroyuki Ishii*
158
-
159
- * Added `#reverse_merge` and `#reverse_merge!` methods to `ActionController::Parameters`
160
-
161
- *Edouard Chin*, *Mitsutaka Mimura*
162
-
163
- * Fix malformed URLS when using `ApplicationController.renderer`
164
-
165
- The Rack environment variable `rack.url_scheme` was not being set so `scheme` was
166
- returning `nil`. This caused URLs to be malformed with the default settings.
167
- Fix this by setting `rack.url_scheme` when the environment is normalized.
168
-
169
- Fixes #28151.
170
-
171
- *George Vrettos*
172
-
173
- * Commit flash changes when using a redirect route.
174
-
175
- Fixes #27992.
176
-
177
- *Andrew White*
178
-
179
- * Prefer `remove_method` over `undef_method` when reloading routes
180
-
181
- When `undef_method` is used it prevents access to other implementations of that
182
- url helper in the ancestor chain so use `remove_method` instead to restore access.
183
-
184
- *Andrew White*
185
-
186
- * Add the `resolve` method to the routing DSL
187
-
188
- This new method allows customization of the polymorphic mapping of models:
189
-
190
- ``` ruby
191
- resource :basket
192
- resolve("Basket") { [:basket] }
193
- ```
194
-
195
- ``` erb
196
- <%= form_for @basket do |form| %>
197
- <!-- basket form -->
198
- <% end %>
199
- ```
200
-
201
- This generates the correct singular URL for the form instead of the default
202
- resources member url, e.g. `/basket` vs. `/basket/:id`.
203
-
204
- Fixes #1769.
205
-
206
- *Andrew White*
207
-
208
- * Add the `direct` method to the routing DSL
209
-
210
- This new method allows creation of custom url helpers, e.g:
211
-
212
- ``` ruby
213
- direct(:apple) { "http://www.apple.com" }
214
-
215
- >> apple_url
216
- => "http://www.apple.com"
217
- ```
218
-
219
- This has the advantage of being available everywhere url helpers are available
220
- unlike custom url helpers defined in helper modules, etc.
221
-
222
- *Andrew White*
223
-
224
- * Add `ActionDispatch::SystemTestCase` to Action Pack
225
-
226
- Adds Capybara integration directly into Rails through Action Pack!
227
-
228
- See PR [#26703](https://github.com/rails/rails/pull/26703)
229
-
230
- *Eileen M. Uchitelle*
231
-
232
- * Remove deprecated `.to_prepare`, `.to_cleanup`, `.prepare!` and `.cleanup!` from `ActionDispatch::Reloader`.
233
-
234
- *Rafael Mendonça França*
235
-
236
- * Remove deprecated `ActionDispatch::Callbacks.to_prepare` and `ActionDispatch::Callbacks.to_cleanup`.
237
-
238
- *Rafael Mendonça França*
239
-
240
- * Remove deprecated `ActionController::Metal.call`.
241
-
242
- *Rafael Mendonça França*
243
-
244
- * Remove deprecated `ActionController::Metal#env`.
245
-
246
- *Rafael Mendonça França*
247
-
248
- * Make `with_routing` test helper work when testing controllers inheriting from `ActionController::API`
249
-
250
- *Julia López*
251
-
252
- * Use accept header in integration tests with `as: :json`
253
-
254
- Instead of appending the `format` to the request path, Rails will figure
255
- out the format from the header instead.
256
-
257
- This allows devs to use `:as` on routes that don't have a format.
258
-
259
- Fixes #27144.
260
-
261
- *Kasper Timm Hansen*
262
-
263
- * Reset a new session directly after its creation in `ActionDispatch::IntegrationTest#open_session`.
264
-
265
- Fixes #22742.
266
-
267
- *Tawan Sierek*
268
-
269
- * Fixes incorrect output from `rails routes` when using singular resources.
270
-
271
- Fixes #26606.
272
-
273
- *Erick Reyna*
274
-
275
- * Fixes multiple calls to `logger.fatal` instead of a single call,
276
- for every line in an exception backtrace, when printing trace
277
- from `DebugExceptions` middleware.
278
-
279
- Fixes #26134.
280
-
281
- *Vipul A M*
282
-
283
- * Add support for arbitrary hashes in strong parameters:
284
-
285
- ```ruby
286
- params.permit(preferences: {})
287
- ```
288
-
289
- *Xavier Noria*
290
-
291
- * Add `ActionController::Parameters#merge!`, which behaves the same as `Hash#merge!`.
292
-
293
- *Yuji Yaginuma*
294
-
295
- * Allow keys not found in `RACK_KEY_TRANSLATION` for setting the environment when rendering
296
- arbitrary templates.
297
-
298
- *Sammy Larbi*
299
-
300
- * Remove deprecated support to non-keyword arguments in `ActionDispatch::IntegrationTest#process`,
301
- `#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head`.
302
-
303
- *Rafael Mendonça França*
304
-
305
- * Remove deprecated `ActionDispatch::IntegrationTest#*_via_redirect`.
306
-
307
- *Rafael Mendonça França*
308
-
309
- * Remove deprecated `ActionDispatch::IntegrationTest#xml_http_request`.
310
-
311
- *Rafael Mendonça França*
312
-
313
- * Remove deprecated support for passing `:path` and route path as strings in `ActionDispatch::Routing::Mapper#match`.
314
-
315
- *Rafael Mendonça França*
316
-
317
- * Remove deprecated support for passing path as `nil` in `ActionDispatch::Routing::Mapper#match`.
318
-
319
- *Rafael Mendonça França*
320
-
321
- * Remove deprecated `cache_control` argument from `ActionDispatch::Static#initialize`.
322
-
323
- *Rafael Mendonça França*
324
-
325
- * Remove deprecated support to passing strings or symbols to the middleware stack.
326
-
327
- *Rafael Mendonça França*
328
-
329
- * Change HSTS subdomain to true.
330
-
331
- *Rafael Mendonça França*
332
-
333
- * Remove deprecated `host` and `port` ssl options.
334
-
335
- *Rafael Mendonça França*
336
-
337
- * Remove deprecated `const_error` argument in
338
- `ActionDispatch::Session::SessionRestoreError#initialize`.
339
-
340
- *Rafael Mendonça França*
341
-
342
- * Remove deprecated `#original_exception` in `ActionDispatch::Session::SessionRestoreError`.
343
-
344
- *Rafael Mendonça França*
345
-
346
- * Deprecate `ActionDispatch::ParamsParser::ParseError` in favor of
347
- `ActionDispatch::Http::Parameters::ParseError`.
348
-
349
- *Rafael Mendonça França*
350
-
351
- * Remove deprecated `ActionDispatch::ParamsParser`.
352
-
353
- *Rafael Mendonça França*
354
-
355
- * Remove deprecated `original_exception` and `message` arguments in
356
- `ActionDispatch::ParamsParser::ParseError#initialize`.
357
-
358
- *Rafael Mendonça França*
359
-
360
- * Remove deprecated `#original_exception` in `ActionDispatch::ParamsParser::ParseError`.
361
-
362
- *Rafael Mendonça França*
363
-
364
- * Remove deprecated access to mime types through constants.
365
-
366
- *Rafael Mendonça França*
367
-
368
- * Remove deprecated support to non-keyword arguments in `ActionController::TestCase#process`,
369
- `#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head`.
370
-
371
- *Rafael Mendonça França*
372
-
373
- * Remove deprecated `xml_http_request` and `xhr` methods in `ActionController::TestCase`.
374
-
375
- *Rafael Mendonça França*
376
-
377
- * Remove deprecated methods in `ActionController::Parameters`.
378
-
379
- *Rafael Mendonça França*
380
-
381
- * Remove deprecated support to comparing a `ActionController::Parameters`
382
- with a `Hash`.
383
-
384
- *Rafael Mendonça França*
385
-
386
- * Remove deprecated support to `:text` in `render`.
387
-
388
- *Rafael Mendonça França*
389
-
390
- * Remove deprecated support to `:nothing` in `render`.
391
-
392
- *Rafael Mendonça França*
393
-
394
- * Remove deprecated support to `:back` in `redirect_to`.
395
-
396
- *Rafael Mendonça França*
397
-
398
- * Remove deprecated support to passing status as option `head`.
399
-
400
- *Rafael Mendonça França*
401
-
402
- * Remove deprecated support to passing original exception to `ActionController::BadRequest`
403
- and the `ActionController::BadRequest#original_exception` method.
404
-
405
- *Rafael Mendonça França*
406
-
407
- * Remove deprecated methods `skip_action_callback`, `skip_filter`, `before_filter`,
408
- `prepend_before_filter`, `skip_before_filter`, `append_before_filter`, `around_filter`
409
- `prepend_around_filter`, `skip_around_filter`, `append_around_filter`, `after_filter`,
410
- `prepend_after_filter`, `skip_after_filter` and `append_after_filter`.
411
-
412
- *Rafael Mendonça França*
413
-
414
- * Show an "unmatched constraints" error when params fail to match constraints
415
- on a matched route, rather than a "missing keys" error.
416
-
417
- Fixes #26470.
418
-
419
- *Chris Carter*
420
-
421
- * Fix adding implicitly rendered template digests to ETags.
422
-
423
- Fixes a case when modifying an implicitly rendered template for a
424
- controller action using `fresh_when` or `stale?` would not result in a new
425
- `ETag` value.
426
-
427
- *Javan Makhmali*
428
-
429
- * Make `fixture_file_upload` work in integration tests.
430
-
431
- *Yuji Yaginuma*
432
-
433
- * Add `to_param` to `ActionController::Parameters` deprecations.
434
-
435
- In the future `ActionController::Parameters` are discouraged from being used
436
- in URLs without explicit whitelisting. Go through `to_h` to use `to_param`.
437
-
438
- *Kir Shatrov*
439
-
440
- * Fix nested multiple roots
441
-
442
- The PR #20940 enabled the use of multiple roots with different constraints
443
- at the top level but unfortunately didn't work when those roots were inside
444
- a namespace and also broke the use of root inside a namespace after a top
445
- level root was defined because the check for the existence of the named route
446
- used the global :root name and not the namespaced name.
447
-
448
- This is fixed by using the name_for_action method to expand the :root name to
449
- the full namespaced name. We can pass nil for the second argument as we're not
450
- dealing with resource definitions so don't need to handle the cases for edit
451
- and new routes.
452
-
453
- Fixes #26148.
454
-
455
- *Ryo Hashimoto*, *Andrew White*
456
-
457
- * Include the content of the flash in the auto-generated etag. This solves the following problem:
458
-
459
- 1. POST /messages
460
- 2. redirect_to messages_url, notice: 'Message was created'
461
- 3. GET /messages/1
462
- 4. GET /messages
463
-
464
- Step 4 would before still include the flash message, even though it's no longer relevant,
465
- because the etag cache was recorded with the flash in place and didn't change when it was gone.
466
-
467
- *DHH*
468
-
469
- * SSL: Changes redirect behavior for all non-GET and non-HEAD requests
470
- (like POST/PUT/PATCH etc) to `http://` resources to redirect to `https://`
471
- with a [307 status code](http://tools.ietf.org/html/rfc7231#section-6.4.7) instead of [301 status code](http://tools.ietf.org/html/rfc7231#section-6.4.2).
472
-
473
- 307 status code instructs the HTTP clients to preserve the original
474
- request method while redirecting. It has been part of HTTP RFC since
475
- 1999 and is implemented/recognized by most (if not all) user agents.
476
-
477
- # Before
478
- POST http://example.com/articles (i.e. ArticlesContoller#create)
479
- redirects to
480
- GET https://example.com/articles (i.e. ArticlesContoller#index)
481
-
482
- # After
483
- POST http://example.com/articles (i.e. ArticlesContoller#create)
484
- redirects to
485
- POST https://example.com/articles (i.e. ArticlesContoller#create)
486
-
487
- *Chirag Singhal*
488
-
489
- * Add `:as` option to `ActionController:TestCase#process` and related methods.
490
-
491
- Specifying `as: mime_type` allows the `CONTENT_TYPE` header to be specified
492
- in controller tests without manually doing this through `@request.headers['CONTENT_TYPE']`.
493
-
494
- *Everest Stefan Munro-Zeisberger*
495
-
496
- * Show cache hits and misses when rendering partials.
497
-
498
- Partials using the `cache` helper will show whether a render hit or missed
499
- the cache:
500
-
501
- ```
502
- Rendered messages/_message.html.erb in 1.2 ms [cache hit]
503
- Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
504
- ```
505
-
506
- This removes the need for the old fragment cache logging:
507
-
508
- ```
509
- Read fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/d0bdf2974e1ef6d31685c3b392ad0b74 (0.6ms)
510
- Rendered messages/_message.html.erb in 1.2 ms [cache hit]
511
- Write fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/3b4e249ac9d168c617e32e84b99218b5 (1.1ms)
512
- Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
513
- ```
514
-
515
- Though that full output can be reenabled with
516
- `config.action_controller.enable_fragment_cache_logging = true`.
517
-
518
- *Stan Lo*
519
-
520
- * Don't override the `Accept` header in integration tests when called with `xhr: true`.
521
-
522
- Fixes #25859.
523
-
524
- *David Chen*
525
-
526
- * Fix `defaults` option for root route.
527
-
528
- A regression from some refactoring for the 5.0 release, this change
529
- fixes the use of `defaults` (default parameters) in the `root` routing method.
530
-
531
- *Chris Arcand*
532
-
533
- * Check `request.path_parameters` encoding at the point they're set.
534
-
535
- Check for any non-UTF8 characters in path parameters at the point they're
536
- set in `env`. Previously they were checked for when used to get a controller
537
- class, but this meant routes that went directly to a Rack app, or skipped
538
- controller instantiation for some other reason, had to defend against
539
- non-UTF8 characters themselves.
540
-
541
- *Grey Baker*
542
-
543
- * Don't raise `ActionController::UnknownHttpMethod` from `ActionDispatch::Static`.
544
-
545
- Pass `Rack::Request` objects to `ActionDispatch::FileHandler` to avoid it
546
- raising `ActionController::UnknownHttpMethod`. If an unknown method is
547
- passed, it should pass exception higher in the stack instead, once we've had a
548
- chance to define exception handling behaviour.
549
-
550
- *Grey Baker*
551
-
552
- * Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`.
553
-
554
- Updated `ActionDispatch::ExceptionWrapper` to handle the Rack 2.0 namespace
555
- for `ParameterTypeError` and `InvalidParameterError` errors.
556
-
557
- *Grey Baker*
558
200
 
559
- Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionpack/CHANGELOG.md) for previous changes.
201
+ Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actionpack/CHANGELOG.md) for previous changes.