actionpack 4.2.11.3 → 5.0.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 (125) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +379 -462
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +2 -3
  5. data/lib/abstract_controller.rb +0 -2
  6. data/lib/abstract_controller/base.rb +17 -32
  7. data/lib/abstract_controller/callbacks.rb +52 -19
  8. data/lib/abstract_controller/collector.rb +4 -9
  9. data/lib/abstract_controller/helpers.rb +2 -2
  10. data/lib/abstract_controller/railties/routes_helpers.rb +2 -2
  11. data/lib/abstract_controller/rendering.rb +27 -22
  12. data/lib/abstract_controller/translation.rb +8 -7
  13. data/lib/action_controller.rb +4 -3
  14. data/lib/action_controller/api.rb +146 -0
  15. data/lib/action_controller/base.rb +6 -10
  16. data/lib/action_controller/caching.rb +1 -3
  17. data/lib/action_controller/caching/fragments.rb +48 -3
  18. data/lib/action_controller/form_builder.rb +48 -0
  19. data/lib/action_controller/log_subscriber.rb +1 -10
  20. data/lib/action_controller/metal.rb +89 -62
  21. data/lib/action_controller/metal/basic_implicit_render.rb +11 -0
  22. data/lib/action_controller/metal/conditional_get.rb +65 -24
  23. data/lib/action_controller/metal/cookies.rb +0 -2
  24. data/lib/action_controller/metal/data_streaming.rb +2 -22
  25. data/lib/action_controller/metal/etag_with_template_digest.rb +1 -1
  26. data/lib/action_controller/metal/exceptions.rb +11 -6
  27. data/lib/action_controller/metal/force_ssl.rb +6 -6
  28. data/lib/action_controller/metal/head.rb +14 -7
  29. data/lib/action_controller/metal/helpers.rb +9 -5
  30. data/lib/action_controller/metal/http_authentication.rb +37 -38
  31. data/lib/action_controller/metal/implicit_render.rb +23 -6
  32. data/lib/action_controller/metal/instrumentation.rb +0 -1
  33. data/lib/action_controller/metal/live.rb +17 -55
  34. data/lib/action_controller/metal/mime_responds.rb +17 -37
  35. data/lib/action_controller/metal/params_wrapper.rb +8 -8
  36. data/lib/action_controller/metal/redirecting.rb +32 -9
  37. data/lib/action_controller/metal/renderers.rb +10 -8
  38. data/lib/action_controller/metal/rendering.rb +38 -6
  39. data/lib/action_controller/metal/request_forgery_protection.rb +67 -35
  40. data/lib/action_controller/metal/rescue.rb +2 -4
  41. data/lib/action_controller/metal/streaming.rb +4 -4
  42. data/lib/action_controller/metal/strong_parameters.rb +231 -78
  43. data/lib/action_controller/metal/testing.rb +1 -12
  44. data/lib/action_controller/metal/url_for.rb +12 -5
  45. data/lib/action_controller/renderer.rb +111 -0
  46. data/lib/action_controller/template_assertions.rb +9 -0
  47. data/lib/action_controller/test_case.rb +267 -363
  48. data/lib/action_dispatch.rb +2 -1
  49. data/lib/action_dispatch/http/cache.rb +23 -26
  50. data/lib/action_dispatch/http/filter_parameters.rb +6 -8
  51. data/lib/action_dispatch/http/filter_redirect.rb +7 -8
  52. data/lib/action_dispatch/http/headers.rb +28 -11
  53. data/lib/action_dispatch/http/mime_negotiation.rb +40 -26
  54. data/lib/action_dispatch/http/mime_type.rb +92 -61
  55. data/lib/action_dispatch/http/mime_types.rb +1 -4
  56. data/lib/action_dispatch/http/parameter_filter.rb +18 -8
  57. data/lib/action_dispatch/http/parameters.rb +45 -41
  58. data/lib/action_dispatch/http/request.rb +146 -82
  59. data/lib/action_dispatch/http/response.rb +180 -99
  60. data/lib/action_dispatch/http/url.rb +117 -8
  61. data/lib/action_dispatch/journey/formatter.rb +34 -28
  62. data/lib/action_dispatch/journey/gtg/transition_table.rb +1 -1
  63. data/lib/action_dispatch/journey/nfa/dot.rb +0 -2
  64. data/lib/action_dispatch/journey/nfa/transition_table.rb +1 -46
  65. data/lib/action_dispatch/journey/nodes/node.rb +14 -4
  66. data/lib/action_dispatch/journey/parser_extras.rb +4 -0
  67. data/lib/action_dispatch/journey/path/pattern.rb +37 -41
  68. data/lib/action_dispatch/journey/route.rb +71 -17
  69. data/lib/action_dispatch/journey/router.rb +5 -6
  70. data/lib/action_dispatch/journey/router/utils.rb +5 -5
  71. data/lib/action_dispatch/journey/routes.rb +14 -15
  72. data/lib/action_dispatch/journey/visitors.rb +86 -43
  73. data/lib/action_dispatch/middleware/cookies.rb +184 -135
  74. data/lib/action_dispatch/middleware/debug_exceptions.rb +115 -45
  75. data/lib/action_dispatch/middleware/exception_wrapper.rb +21 -20
  76. data/lib/action_dispatch/middleware/flash.rb +61 -45
  77. data/lib/action_dispatch/middleware/load_interlock.rb +21 -0
  78. data/lib/action_dispatch/middleware/params_parser.rb +30 -46
  79. data/lib/action_dispatch/middleware/public_exceptions.rb +2 -2
  80. data/lib/action_dispatch/middleware/reloader.rb +2 -4
  81. data/lib/action_dispatch/middleware/remote_ip.rb +29 -19
  82. data/lib/action_dispatch/middleware/request_id.rb +11 -6
  83. data/lib/action_dispatch/middleware/session/abstract_store.rb +23 -11
  84. data/lib/action_dispatch/middleware/session/cache_store.rb +9 -6
  85. data/lib/action_dispatch/middleware/session/cookie_store.rb +29 -23
  86. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +4 -0
  87. data/lib/action_dispatch/middleware/show_exceptions.rb +11 -9
  88. data/lib/action_dispatch/middleware/ssl.rb +93 -36
  89. data/lib/action_dispatch/middleware/stack.rb +43 -48
  90. data/lib/action_dispatch/middleware/static.rb +52 -40
  91. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +2 -14
  92. data/lib/action_dispatch/middleware/templates/rescues/{_source.erb → _source.html.erb} +0 -0
  93. data/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
  94. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +1 -1
  95. data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +1 -1
  96. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +4 -4
  97. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +59 -63
  98. data/lib/action_dispatch/railtie.rb +0 -2
  99. data/lib/action_dispatch/request/session.rb +66 -34
  100. data/lib/action_dispatch/request/utils.rb +51 -19
  101. data/lib/action_dispatch/routing.rb +3 -8
  102. data/lib/action_dispatch/routing/inspector.rb +6 -30
  103. data/lib/action_dispatch/routing/mapper.rb +447 -322
  104. data/lib/action_dispatch/routing/polymorphic_routes.rb +8 -14
  105. data/lib/action_dispatch/routing/redirection.rb +3 -3
  106. data/lib/action_dispatch/routing/route_set.rb +124 -227
  107. data/lib/action_dispatch/routing/url_for.rb +27 -10
  108. data/lib/action_dispatch/testing/assertions.rb +1 -1
  109. data/lib/action_dispatch/testing/assertions/response.rb +27 -9
  110. data/lib/action_dispatch/testing/assertions/routing.rb +9 -9
  111. data/lib/action_dispatch/testing/integration.rb +237 -76
  112. data/lib/action_dispatch/testing/test_process.rb +5 -5
  113. data/lib/action_dispatch/testing/test_request.rb +12 -21
  114. data/lib/action_dispatch/testing/test_response.rb +1 -4
  115. data/lib/action_pack.rb +1 -1
  116. data/lib/action_pack/gem_version.rb +4 -4
  117. metadata +26 -25
  118. data/lib/action_controller/metal/hide_actions.rb +0 -40
  119. data/lib/action_controller/metal/rack_delegation.rb +0 -32
  120. data/lib/action_controller/middleware.rb +0 -39
  121. data/lib/action_controller/model_naming.rb +0 -12
  122. data/lib/action_dispatch/journey/router/strexp.rb +0 -27
  123. data/lib/action_dispatch/testing/assertions/dom.rb +0 -3
  124. data/lib/action_dispatch/testing/assertions/selector.rb +0 -3
  125. data/lib/action_dispatch/testing/assertions/tag.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 7b149e341681eb3597a0f7d84b4e79752c9158dcf7d37304ef2c62fe533a8d78
4
- data.tar.gz: a0247c959d61ccdee256a600caca6032894ceac1494ce4c2f7e9167a682079a1
2
+ SHA1:
3
+ metadata.gz: b8eece084b0d46f0491133f5962fe75948897d38
4
+ data.tar.gz: 85bc45eacfb08495798916de51388ed289fd8c4c
5
5
  SHA512:
6
- metadata.gz: e9e77c79a89b8de26559b2468cf53ca02df390ef6ec0c88a9b8b7cbb356f2e0a0e1c530bc1cd5f4ab62b429425d23f2efb4fafd2d1349c6dcf77546d76ddb2aa
7
- data.tar.gz: 9ce00ebedd2d8cb7219031fc7fad0c2bc2f0cb31230cc898f04a7e410f4ac9b2562603d8590de2eb50d875ba1bcce1fe1c82ddb1861ce0f707029e39f0dc7fc6
6
+ metadata.gz: fa4d4c43da0d0c86b545b6cb81da6363c3a8a9576d475550d1637de0b9f0d18bc59542680d7be1459a205ffe9ca25d8184f944c990e4ad3f354331dc2ca0efc8
7
+ data.tar.gz: cf96d44d85b60080df44c3c0d8a8d5526879afbcfcb685758ebeb822268a7c8e27654560aa9a68034ce1ca87a71eccf739de2958680eb674af5b1912e2635abe
@@ -1,121 +1,186 @@
1
- ## Rails 4.2.11.3 (May 15, 2020) ##
1
+ ## Rails 5.0.0.beta1 (December 18, 2015) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 4.2.11.2 (May 15, 2020) ##
6
+ * Deprecate `redirect_to :back` in favor of `redirect_back`, which accepts a
7
+ required `fallback_location` argument, thus eliminating the possibility of a
8
+ `RedirectBackError`.
7
9
 
8
- * No changes.
10
+ *Derek Prior*
9
11
 
12
+ * Add `redirect_back` method to `ActionController::Redirecting` to provide a
13
+ way to safely redirect to the `HTTP_REFERER` if it is present, falling back
14
+ to a provided redirect otherwise.
10
15
 
11
- ## Rails 4.2.11.1 (March 11, 2019) ##
16
+ *Derek Prior*
12
17
 
13
- * No changes.
18
+ * `ActionController::TestCase` will be moved to it's own gem in Rails 5.1
14
19
 
20
+ With the speed improvements made to `ActionDispatch::IntegrationTest` we no
21
+ longer need to keep two separate code bases for testing controllers. In
22
+ Rails 5.1 `ActionController::TestCase` will be deprecated and moved into a
23
+ gem outside of Rails source.
15
24
 
16
- ## Rails 4.2.11 (November 27, 2018) ##
25
+ This is a documentation deprecation so that going forward so new tests will use
26
+ `ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`.
17
27
 
18
- * No changes.
28
+ *Eileen M. Uchitelle*
19
29
 
30
+ * Add a `response_format` option to `ActionDispatch::DebugExceptions`
31
+ to configure the format of the response when errors occur in
32
+ development mode.
20
33
 
21
- ## Rails 4.2.10 (September 27, 2017) ##
34
+ If `response_format` is `:default` the debug info will be rendered
35
+ in an HTML page. In the other hand, if the provided value is `:api`
36
+ the debug info will be rendered in the original response format.
22
37
 
23
- * Fix regression in behavior of `normalize_path`.
38
+ *Jorge Bejar*
24
39
 
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.
40
+ * Change the `protect_from_forgery` prepend default to `false`
28
41
 
29
- *Eileen M. Uchitelle*
42
+ Per this comment
43
+ https://github.com/rails/rails/pull/18334#issuecomment-69234050 we want
44
+ `protect_from_forgery` to default to `prepend: false`.
30
45
 
31
- ## Rails 4.2.9 (June 26, 2017) ##
46
+ `protect_from_forgery` will now be insterted into the callback chain at the
47
+ point it is called in your application. This is useful for cases where you
48
+ want to `protect_from_forgery` after you perform required authentication
49
+ callbacks or other callbacks that are required to run after forgery protection.
32
50
 
33
- * Use more specific check for :format in route path
51
+ If you want `protect_from_forgery` callbacks to always run first, regardless of
52
+ position they are called in your application then you can add `prepend: true`
53
+ to your `protect_from_forgery` call.
34
54
 
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
+ Example:
37
56
 
38
- ``` ruby
39
- resources :formats do
40
- resources :items
41
- end
57
+ ```ruby
58
+ protect_from_forgery prepend: true
42
59
  ```
43
60
 
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:
47
-
48
- ``` ruby
49
- get "/books(/:action(.:format))", controller: "books"
50
- ```
61
+ *Eileen M. Uchitelle*
51
62
 
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.
63
+ * In url_for, never append a question mark to the URL when the query string
64
+ is empty anyway. (It used to do that when called like `url_for(controller:
65
+ 'x', action: 'y', q: {})`.)
54
66
 
55
- Fixes #28517.
67
+ *Paul Grayson*
56
68
 
57
- *Andrew White*
69
+ * Catch invalid UTF-8 querystring values and respond with BadRequest
58
70
 
71
+ Check querystring params for invalid UTF-8 characters, and raise an
72
+ ActionController::BadRequest error if present. Previously these strings
73
+ would typically trigger errors further down the stack.
59
74
 
60
- ## Rails 4.2.8 (February 21, 2017) ##
75
+ *Grey Baker*
61
76
 
62
- * No changes.
77
+ * Parse RSS/ATOM responses as XML, not HTML.
63
78
 
79
+ *Alexander Kaupanin*
64
80
 
65
- ## Rails 4.2.7 (July 12, 2016) ##
81
+ * Show helpful message in `BadRequest` exceptions due to invalid path
82
+ parameter encodings.
66
83
 
67
- * No changes.
84
+ Fixes #21923.
68
85
 
86
+ *Agis Anastasopoulos*
69
87
 
70
- ## Rails 4.2.6 (March 07, 2016) ##
88
+ * Add the ability of returning arbitrary headers to ActionDispatch::Static
71
89
 
72
- * No changes.
90
+ Now ActionDispatch::Static can accept HTTP headers so that developers
91
+ will have control of returning arbitrary headers like
92
+ 'Access-Control-Allow-Origin' when a response is delivered. They can be
93
+ configured with `#config`:
73
94
 
95
+ config.public_file_server.headers = {
96
+ "Cache-Control" => "public, max-age=60",
97
+ "Access-Control-Allow-Origin" => "http://rubyonrails.org"
98
+ }
74
99
 
75
- ## Rails 4.2.5.2 (February 26, 2016) ##
100
+ *Yuki Nishijima*
76
101
 
77
- * Do not allow render with unpermitted parameter.
102
+ * Allow multiple `root` routes in same scope level. Example:
78
103
 
79
- Fixes CVE-2016-2098.
104
+ ```ruby
105
+ root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) }
106
+ root 'landing#show'
107
+ ```
108
+ *Rafael Sales*
80
109
 
81
- *Arthur Neves*
110
+ * Fix regression in mounted engine named routes generation for app deployed to
111
+ a subdirectory. `relative_url_root` was prepended to the path twice (e.g.
112
+ "/subdir/subdir/engine_path" instead of "/subdir/engine_path")
82
113
 
114
+ Fixes #20920. Fixes #21459.
83
115
 
84
- ## Rails 4.2.5.1 (January 25, 2015) ##
116
+ *Matthew Erhard*
85
117
 
86
- * No changes.
118
+ * ActionDispatch::Response#new no longer applies default headers. If you want
119
+ default headers applied to the response object, then call
120
+ `ActionDispatch::Response.create`. This change only impacts people who are
121
+ directly constructing an `ActionDispatch::Response` object.
87
122
 
123
+ * Accessing mime types via constants like `Mime::HTML` is deprecated. Please
124
+ change code like this:
88
125
 
89
- ## Rails 4.2.5 (November 12, 2015) ##
126
+ Mime::HTML
90
127
 
91
- * `ActionController::TestCase` can teardown gracefully if an error is raised
92
- early in the `setup` chain.
128
+ To this:
93
129
 
94
- *Yves Senn*
130
+ Mime[:html]
95
131
 
96
- * Parse RSS/ATOM responses as XML, not HTML.
132
+ This change is so that Rails will not manage a list of constants, and fixes
133
+ an issue where if a type isn't registered you could possibly get the wrong
134
+ object.
97
135
 
98
- *Alexander Kaupanin*
99
-
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")
103
-
104
- Fixes #20920. Fixes #21459.
105
-
106
- *Matthew Erhard*
136
+ `Mime[:html]` is available in older versions of Rails, too, so you can
137
+ safely change libraries and plugins and maintain compatibility with
138
+ multiple versions of Rails.
107
139
 
108
140
  * `url_for` does not modify its arguments when generating polymorphic URLs.
109
141
 
110
142
  *Bernerd Schaefer*
111
143
 
144
+ * Make it easier to opt in to `config.force_ssl` and `config.ssl_options` by
145
+ making them less dangerous to try and easier to disable.
146
+
147
+ SSL redirect:
148
+ * Move `:host` and `:port` options within `redirect: { … }`. Deprecate.
149
+ * Introduce `:status` and `:body` to customize the redirect response.
150
+ The 301 permanent default makes it difficult to test the redirect and
151
+ back out of it since browsers remember the 301. Test with a 302 or 307
152
+ instead, then switch to 301 once you're confident that all is well.
153
+
154
+ HTTP Strict Transport Security (HSTS):
155
+ * Shorter max-age. Shorten the default max-age from 1 year to 180 days,
156
+ the low end for https://www.ssllabs.com/ssltest/ grading and greater
157
+ than the 18-week minimum to qualify for browser preload lists.
158
+ * Disabling HSTS. Setting `hsts: false` now sets `hsts { expires: 0 }`
159
+ instead of omitting the header. Omitting does nothing to disable HSTS
160
+ since browsers hang on to your previous settings until they expire.
161
+ Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and
162
+ actually disables HSTS:
163
+ http://tools.ietf.org/html/rfc6797#section-6.1.1
164
+ * HSTS Preload. Introduce `preload: true` to set the `preload` flag,
165
+ indicating that your site may be included in browser preload lists,
166
+ including Chrome, Firefox, Safari, IE11, and Edge. Submit your site:
167
+ https://hstspreload.appspot.com
168
+
169
+ *Jeremy Daer*
170
+
112
171
  * Update `ActionController::TestSession#fetch` to behave more like
113
172
  `ActionDispatch::Request::Session#fetch` when using non-string keys.
114
173
 
115
174
  *Jeremy Friesen*
116
175
 
176
+ * Using strings or symbols for middleware class names is deprecated. Convert
177
+ things like this:
178
+
179
+ middleware.use "Foo::Bar"
180
+
181
+ to this:
117
182
 
118
- ## Rails 4.2.4 (August 24, 2015) ##
183
+ middleware.use Foo::Bar
119
184
 
120
185
  * ActionController::TestSession now accepts a default value as well as
121
186
  a block for generating a default value based off the key provided.
@@ -126,565 +191,417 @@
126
191
 
127
192
  *Matthew Gerrior*
128
193
 
129
- * Fix to keep original header instance in `ActionDispatch::SSL`
194
+ * Fix `ActionController::Parameters#fetch` overwriting `KeyError` returned by
195
+ default block.
130
196
 
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`.
197
+ *Jonas Schuber Erlandsson*, *Roque Pinel*
134
198
 
135
- *Fumiaki Matsushima*
199
+ * `ActionController::Parameters` no longer inherits from
200
+ `HashWithIndifferentAccess`
136
201
 
202
+ Inheriting from `HashWithIndifferentAccess` allowed users to call any
203
+ enumerable methods on `Parameters` object, resulting in a risk of losing the
204
+ `permitted?` status or even getting back a pure `Hash` object instead of
205
+ a `Parameters` object with proper sanitization.
137
206
 
138
- ## Rails 4.2.3 (June 25, 2015) ##
207
+ By not inheriting from `HashWithIndifferentAccess`, we are able to make
208
+ sure that all methods that are defined in `Parameters` object will return
209
+ a proper `Parameters` object with a correct `permitted?` flag.
139
210
 
140
- * Fix rake routes not showing the right format when
141
- nesting multiple routes.
142
-
143
- See #18373.
144
-
145
- *Ravil Bayramgalin*
146
-
147
- * Fix regression where a gzip file response would have a Content-type,
148
- even when it was a 304 status code.
211
+ *Prem Sichanugrist*
149
212
 
150
- See #19271.
213
+ * Replaced `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`
214
+ from the concurrent-ruby gem.
151
215
 
152
- *Kohei Suzuki*
216
+ *Jerry D'Antonio*
153
217
 
154
- * Fix handling of empty X_FORWARDED_HOST header in raw_host_with_port
218
+ * Add ability to filter parameters based on parent keys.
155
219
 
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.
220
+ # matches {credit_card: {code: "xxxx"}}
221
+ # doesn't match {file: { code: "xxxx"}}
222
+ config.filter_parameters += [ "credit_card.code" ]
159
223
 
160
- *Adam Forsyth*
161
-
162
- * Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
224
+ See #13897.
163
225
 
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.
226
+ *Guillaume Malette*
167
227
 
168
- Fixes #5122.
228
+ * Deprecate passing first parameter as `Hash` and default status code for `head` method.
169
229
 
170
- *Yasyf Mohamedali*
230
+ *Mehmet Emin İNAÇ*
171
231
 
172
- * Fix regression in functional tests. Responses should have default headers
173
- assigned.
232
+ * Adds`Rack::Utils::ParameterTypeError` and `Rack::Utils::InvalidParameterError`
233
+ to the rescue_responses hash in `ExceptionWrapper` (Rack recommends
234
+ integrators serve 400s for both of these).
174
235
 
175
- See #18423.
236
+ *Grey Baker*
176
237
 
177
- *Jeremy Kemper*, *Yves Senn*
238
+ * Add support for API only apps.
239
+ ActionController::API is added as a replacement of
240
+ ActionController::Base for this kind of applications.
178
241
 
242
+ *Santiago Pastorino & Jorge Bejar*
179
243
 
180
- ## Rails 4.2.2 (June 16, 2015) ##
244
+ * Remove `assigns` and `assert_template`. Both methods have been extracted
245
+ into a gem at https://github.com/rails/rails-controller-testing.
181
246
 
182
- * No Changes *
247
+ See #18950.
183
248
 
249
+ *Alan Guo Xiang Tan*
184
250
 
185
- ## Rails 4.2.1 (March 19, 2015) ##
251
+ * `FileHandler` and `Static` middleware initializers accept `index` argument
252
+ to configure the directory index file name. Defaults to `index` (as in
253
+ `index.html`).
186
254
 
187
- * Non-string authenticity tokens do not raise NoMethodError when decoding
188
- the masked token.
255
+ See #20017.
189
256
 
190
- *Ville Lautanala*
257
+ *Eliot Sykes*
191
258
 
192
- * Explicitly ignored wildcard verbs when searching for HEAD routes before fallback
259
+ * Deprecate `:nothing` option for `render` method.
193
260
 
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.
261
+ *Mehmet Emin İNAÇ*
196
262
 
197
- Example:
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.
263
+ * Fix `rake routes` not showing the right format when
264
+ nesting multiple routes.
209
265
 
210
- *Terence Sun*
266
+ See #18373.
211
267
 
212
- * Preserve default format when generating URLs
268
+ *Ravil Bayramgalin*
213
269
 
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.
270
+ * Add ability to override default form builder for a controller.
217
271
 
218
- Backport of #18627
272
+ class AdminController < ApplicationController
273
+ default_form_builder AdminFormBuilder
274
+ end
219
275
 
220
- *Tekin Suleyman*, *Dominic Baggott*
276
+ *Kevin McPhillips*
221
277
 
222
- * Default headers, removed in controller actions, are no longer reapplied on
223
- the test response.
278
+ * For actions with no corresponding templates, render `head :no_content`
279
+ instead of raising an error. This allows for slimmer API controller
280
+ methods that simply work, without needing further instructions.
224
281
 
225
- *Jonas Baumann*
282
+ See #19036.
226
283
 
227
- * Ensure `append_info_to_payload` is called even if an exception is raised.
284
+ *Stephen Bussey*
228
285
 
229
- Fixes an issue where when an exception is raised in the request the additonal
230
- payload data is not available.
286
+ * Provide friendlier access to request variants.
231
287
 
232
- See:
233
- * #14903
234
- * https://github.com/roidrage/lograge/issues/37
288
+ request.variant = :phone
289
+ request.variant.phone? # true
290
+ request.variant.tablet? # false
235
291
 
236
- *Dieter Komendera*, *Margus Pärt*
292
+ request.variant = [:phone, :tablet]
293
+ request.variant.phone? # true
294
+ request.variant.desktop? # false
295
+ request.variant.any?(:phone, :desktop) # true
296
+ request.variant.any?(:desktop, :watch) # false
237
297
 
238
- * Correctly rely on the response's status code to handle calls to `head`.
298
+ *George Claghorn*
239
299
 
240
- *Robin Dupret*
300
+ * Fix regression where a gzip file response would have a Content-type,
301
+ even when it was a 304 status code.
241
302
 
242
- * Using `head` method returns empty response_body instead
243
- of returning a single space " ".
303
+ See #19271.
244
304
 
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.
305
+ *Kohei Suzuki*
249
306
 
250
- Fixes #18253.
307
+ * Fix handling of empty `X_FORWARDED_HOST` header in `raw_host_with_port`.
251
308
 
252
- *Prathamesh Sonpatki*
309
+ Previously, an empty `X_FORWARDED_HOST` header would cause
310
+ `Actiondispatch::Http:URL.raw_host_with_port` to return `nil`, causing
311
+ `Actiondispatch::Http:URL.host` to raise a `NoMethodError`.
253
312
 
254
- * Fix how polymorphic routes works with objects that implement `to_model`.
313
+ *Adam Forsyth*
255
314
 
256
- *Travis Grathwell*
315
+ * Allow `Bearer` as token-keyword in `Authorization-Header`.
257
316
 
258
- * Fixed handling of positional url helper arguments when `format: false`.
317
+ Aditionally to `Token`, the keyword `Bearer` is acceptable as a keyword
318
+ for the auth-token. The `Bearer` keyword is described in the original
319
+ OAuth RFC and used in libraries like Angular-JWT.
259
320
 
260
- Fixes #17819.
321
+ See #19094.
261
322
 
262
- *Andrew White*, *Tatiana Soukiassian*
323
+ *Peter Schröder*
263
324
 
264
- * Fixed usage of optional scopes in URL helpers.
325
+ * Drop request class from RouteSet constructor.
265
326
 
266
- *Alex Robbin*
327
+ If you would like to use a custom request class, please subclass and implement
328
+ the `request_class` method.
267
329
 
330
+ *tenderlove@ruby-lang.org*
268
331
 
269
- ## Rails 4.2.0 (December 20, 2014) ##
332
+ * Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
270
333
 
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.
334
+ Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not
335
+ prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack)
336
+ is set, it takes precedence.
275
337
 
276
- *Prem Sichanugrist*
338
+ Fixes #5122.
277
339
 
278
- * Restore handling of a bare `Authorization` header, without `token=`
279
- prefix.
340
+ *Yasyf Mohamedali*
280
341
 
281
- Fixes #17108.
342
+ * Partitioning of routes is now done when the routes are being drawn. This
343
+ helps to decrease the time spent filtering the routes during the first request.
282
344
 
283
345
  *Guo Xiang Tan*
284
346
 
285
- * Deprecate use of string keys in URL helpers.
286
-
287
- Use symbols instead.
288
- Fixes #16958.
347
+ * Fix regression in functional tests. Responses should have default headers
348
+ assigned.
289
349
 
290
- *Byron Bischoff*, *Melanie Gilman*
350
+ See #18423.
291
351
 
292
- * Deprecate the `only_path` option on `*_path` helpers.
352
+ *Jeremy Kemper*, *Yves Senn*
293
353
 
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.
354
+ * Deprecate AbstractController#skip_action_callback in favor of individual skip_callback methods
355
+ (which can be made to raise an error if no callback was removed).
297
356
 
298
- Fixes #17294.
357
+ *Iain Beeston*
299
358
 
300
- *Dan Olson*, *Godfrey Chan*
359
+ * Alias the `ActionDispatch::Request#uuid` method to `ActionDispatch::Request#request_id`.
360
+ Due to implementation, `config.log_tags = [:request_id]` also works in substitute
361
+ for `config.log_tags = [:uuid]`.
301
362
 
302
- * Improve Journey compliance to RFC 3986.
363
+ *David Ilizarov*
303
364
 
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.
365
+ * Change filter on /rails/info/routes to use an actual path regexp from rails
366
+ and not approximate javascript version. Oniguruma supports much more
367
+ extensive list of features than javascript regexp engine.
307
368
 
308
- Fixes #17212.
369
+ Fixes #18402.
309
370
 
310
- *Nicolas Cavigneaux*
371
+ *Ravil Bayramgalin*
311
372
 
312
- * Deprecate implicit Array conversion for Response objects. It was added
313
- (using `#to_ary`) so we could conveniently use implicit splatting:
373
+ * Non-string authenticity tokens do not raise NoMethodError when decoding
374
+ the masked token.
314
375
 
315
- status, headers, body = response
376
+ *Ville Lautanala*
316
377
 
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`:
378
+ * Add `http_cache_forever` to Action Controller, so we can cache a response
379
+ that never gets expired.
320
380
 
321
- status, header, body = *response
381
+ *arthurnn*
322
382
 
323
- *Jeremy Kemper*
383
+ * `ActionController#translate` supports symbols as shortcuts.
384
+ When a shortcut is given it also performs the lookup without the action
385
+ name.
324
386
 
325
- * Don't rescue `IPAddr::InvalidAddressError`.
387
+ *Max Melentiev*
326
388
 
327
- `IPAddr::InvalidAddressError` does not exist in Ruby 1.9.3
328
- and fails for JRuby in 1.9 mode.
389
+ * Expand `ActionController::ConditionalGet#fresh_when` and `stale?` to also
390
+ accept a collection of records as the first argument, so that the
391
+ following code can be written in a shorter form.
329
392
 
330
- *Peter Suschlik*
393
+ # Before
394
+ def index
395
+ @articles = Article.all
396
+ fresh_when(etag: @articles, last_modified: @articles.maximum(:updated_at))
397
+ end
331
398
 
332
- * Fix bug where the router would ignore any constraints added to redirect
333
- routes.
399
+ # After
400
+ def index
401
+ @articles = Article.all
402
+ fresh_when(@articles)
403
+ end
334
404
 
335
- Fixes #16605.
405
+ *claudiob*
336
406
 
337
- *Agis Anastasopoulos*
407
+ * Explicitly ignored wildcard verbs when searching for HEAD routes before fallback
338
408
 
339
- * Allow `config.action_dispatch.trusted_proxies` to accept an IPAddr object.
409
+ Fixes an issue where a mounted rack app at root would intercept the HEAD
410
+ request causing an incorrect behavior during the fall back to GET requests.
340
411
 
341
412
  Example:
342
413
 
343
- # config/environments/production.rb
344
- config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
345
-
346
- *Sam Aarons*
347
-
348
- * Avoid duplicating routes for HEAD requests.
349
-
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.
353
-
354
- *Guo Xiang Tan*, *Andrew White*
355
-
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.
359
-
360
- *Richard Schneeman*
361
-
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.
366
-
367
- *Prem Sichanugrist*
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`.
375
-
376
- params = ActionController::Parameters.new({
377
- name: 'Senjougahara Hitagi',
378
- oddity: 'Heavy stone crab'
379
- })
380
- params.to_h
381
- # => {}
382
-
383
- unsafe_params = params.dup.permit!
384
- unsafe_params.to_h
385
- # => {"name"=>"Senjougahara Hitagi", "oddity"=>"Heavy stone crab"}
386
-
387
- safe_params = params.permit(:name)
388
- safe_params.to_h
389
- # => {"name"=>"Senjougahara Hitagi"}
390
-
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.
394
-
395
- *Prem Sichanugrist*
396
-
397
- * Deprecated `TagAssertions`.
398
-
399
- *Kasper Timm Hansen*
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.
404
-
405
- Fixes #16520.
406
-
407
- *Godfrey Chan*
408
-
409
- * Add `config.action_dispatch.cookies_digest` option for setting custom
410
- digest. The default remains the same - 'SHA1'.
411
-
412
- *Łukasz Strzałkowski*
413
-
414
- * Move `respond_with` (and the class-level `respond_to`) to
415
- the `responders` gem.
416
-
417
- *José Valim*
418
-
419
- * When your templates change, browser caches bust automatically.
420
-
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.
425
-
426
- If you render a different template, you can now pass the `:template`
427
- option to include its digest instead:
428
-
429
- fresh_when @post, template: 'widgets/show'
430
-
431
- Pass `template: false` to skip the lookup. To turn this off entirely, set:
432
-
433
- config.action_controller.etag_with_template_digest = false
434
-
435
- *Jeremy Kemper*
436
-
437
- * Remove deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
438
- in favor of `AbstractController::Helpers::MissingHelperError`.
439
-
440
- *Yves Senn*
441
-
442
- * Fix `assert_template` not being able to assert that no files were rendered.
443
-
444
- *Guo Xiang Tan*
445
-
446
- * Extract source code for the entire exception stack trace for
447
- better debugging and diagnosis.
448
-
449
- *Ryan Dao*
450
-
451
- * Allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8
452
- loopback address.
453
-
454
- *Earl St Sauver*, *Sven Riedel*
455
-
456
- * Preserve original path in `ShowExceptions` middleware by stashing it as
457
- `env["action_dispatch.original_path"]`
458
-
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"]`.
464
-
465
- *Grey Baker*
466
-
467
- * Use `String#bytesize` instead of `String#size` when checking for cookie
468
- overflow.
469
-
470
- *Agis Anastasopoulos*
471
-
472
- * `render nothing: true` or rendering a `nil` body no longer add a single
473
- space to the response body.
474
-
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.
479
-
480
- Use `render body: ' '` if the old behavior is desired.
481
-
482
- See #14883 for details.
483
-
484
- *Godfrey Chan*
485
-
486
- * Prepend a JS comment to JSONP callbacks. Addresses CVE-2014-4671
487
- ("Rosetta Flash").
488
-
489
- *Greg Campbell*
414
+ draw do
415
+ get '/home' => 'test#index'
416
+ mount rack_app, at: '/'
417
+ end
418
+ head '/home'
419
+ assert_response :success
490
420
 
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.
495
-
496
- Fixes #16104.
497
-
498
- *Karl Entwistle*
499
-
500
- * Generate shallow paths for all children of shallow resources.
501
-
502
- Fixes #15783.
421
+ In this case, a HEAD request runs through the routes the first time and fails
422
+ to match anything. Then, it runs through the list with the fallback and matches
423
+ `get '/home'`. The original behavior would match the rack app in the first pass.
503
424
 
504
- *Seb Jacobs*
425
+ *Terence Sun*
505
426
 
506
- * JSONP responses are now rendered with the `text/javascript` content type
507
- when rendering through a `respond_to` block.
427
+ * Migrating xhr methods to keyword arguments syntax
428
+ in `ActionController::TestCase` and `ActionDispatch::Integration`
508
429
 
509
- Fixes #15081.
430
+ Old syntax:
510
431
 
511
- *Lucas Mazza*
432
+ xhr :get, :create, params: { id: 1 }
512
433
 
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']`.
434
+ New syntax example:
516
435
 
517
- *Gary S. Weaver*, *Rafael Chacon*
436
+ get :create, params: { id: 1 }, xhr: true
518
437
 
519
- * Fix env['PATH_INFO'] missing leading slash when a rack app mounted at '/'.
438
+ *Kir Shatrov*
520
439
 
521
- Fixes #15511.
440
+ * Migrating to keyword arguments syntax in `ActionController::TestCase` and
441
+ `ActionDispatch::Integration` HTTP request methods.
522
442
 
523
- *Larry Lv*
443
+ Example:
524
444
 
525
- * ActionController::Parameters#require now accepts `false` values.
445
+ post :create, params: { y: x }, session: { a: 'b' }
446
+ get :view, params: { id: 1 }
447
+ get :view, params: { id: 1 }, format: :json
526
448
 
527
- Fixes #15685.
449
+ *Kir Shatrov*
528
450
 
529
- *Sergio Romano*
451
+ * Preserve default url options when generating URLs.
530
452
 
531
- * With authorization header `Authorization: Token token=`, `authenticate` now
532
- recognize token as nil, instead of "token".
453
+ Fixes an issue that would cause `default_url_options` to be lost when
454
+ generating URLs with fewer positional arguments than parameters in the
455
+ route definition.
533
456
 
534
- Fixes #14846.
457
+ *Tekin Suleyman*
535
458
 
536
- *Larry Lv*
459
+ * Deprecate `*_via_redirect` integration test methods.
537
460
 
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.
461
+ Use `follow_redirect!` manually after the request call for the same behavior.
540
462
 
541
- *Nicholas Jakobsen*, *Matthew Draper*
463
+ *Aditya Kapoor*
542
464
 
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`.
465
+ * Add `ActionController::Renderer` to render arbitrary templates
466
+ outside controller actions.
546
467
 
547
- *Aaron Patterson*
468
+ Its functionality is accessible through class methods `render` and
469
+ `renderer` of `ActionController::Base`.
548
470
 
549
- * Fix URL generation with `:trailing_slash` such that it does not add
550
- a trailing slash after `.:format`
471
+ *Ravil Bayramgalin*
551
472
 
552
- *Dan Langevin*
473
+ * Support `:assigns` option when rendering with controllers/mailers.
553
474
 
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.
475
+ *Ravil Bayramgalin*
559
476
 
560
- *Guo Xiang Tan*
477
+ * Default headers, removed in controller actions, are no longer reapplied on
478
+ the test response.
561
479
 
562
- * Fix `'Stack level too deep'` when rendering `head :ok` in an action method
563
- called 'status' in a controller.
480
+ *Jonas Baumann*
564
481
 
565
- Fixes #13905.
482
+ * Deprecate all `*_filter` callbacks in favor of `*_action` callbacks.
566
483
 
567
- *Christiaan Van den Poel*
484
+ *Rafael Mendonça França*
568
485
 
569
- * Add MKCALENDAR HTTP method (RFC 4791).
486
+ * Allow you to pass `prepend: false` to `protect_from_forgery` to have the
487
+ verification callback appended instead of prepended to the chain.
488
+ This allows you to let the verification step depend on prior callbacks.
570
489
 
571
- *Sergey Karpesh*
490
+ Example:
572
491
 
573
- * Instrument fragment cache metrics.
492
+ class ApplicationController < ActionController::Base
493
+ before_action :authenticate
494
+ protect_from_forgery prepend: false, unless: -> { @authenticated_by.oauth? }
574
495
 
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.
496
+ private
497
+ def authenticate
498
+ if oauth_request?
499
+ # authenticate with oauth
500
+ @authenticated_by = 'oauth'.inquiry
501
+ else
502
+ # authenticate with cookies
503
+ @authenticated_by = 'cookie'.inquiry
504
+ end
505
+ end
506
+ end
578
507
 
579
- *Daniel Schierbeck*
508
+ *Josef Šimánek*
580
509
 
581
- * Always use the provided port if the protocol is relative.
510
+ * Remove `ActionController::HideActions`.
582
511
 
583
- Fixes #15043.
512
+ *Ravil Bayramgalin*
584
513
 
585
- *Guilherme Cavalcanti*, *Andrew White*
514
+ * Remove `respond_to`/`respond_with` placeholder methods, this functionality
515
+ has been extracted to the `responders` gem.
586
516
 
587
- * Moved `params[request_forgery_protection_token]` into its own method
588
- and improved tests.
517
+ *Carlos Antonio da Silva*
589
518
 
590
- Fixes #11316.
519
+ * Remove deprecated assertion files.
591
520
 
592
- *Tom Kadwill*
521
+ *Rafael Mendonça França*
593
522
 
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.
523
+ * Remove deprecated usage of string keys in URL helpers.
598
524
 
599
- *Xavier Defrang*
525
+ *Rafael Mendonça França*
600
526
 
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.
527
+ * Remove deprecated `only_path` option on `*_path` helpers.
604
528
 
605
- Fixes #12638.
529
+ *Rafael Mendonça França*
606
530
 
607
- *Caleb Spare*
531
+ * Remove deprecated `NamedRouteCollection#helpers`.
608
532
 
609
- * Fixed an issue with migrating legacy json cookies.
533
+ *Rafael Mendonça França*
610
534
 
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.
535
+ * Remove deprecated support to define routes with `:to` option that doesn't contain `#`.
614
536
 
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.
537
+ *Rafael Mendonça França*
617
538
 
618
- Fixes #14774.
539
+ * Remove deprecated `ActionDispatch::Response#to_ary`.
619
540
 
620
- *Godfrey Chan*
541
+ *Rafael Mendonça França*
621
542
 
622
- * Make URL escaping more consistent:
543
+ * Remove deprecated `ActionDispatch::Request#deep_munge`.
623
544
 
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
545
+ *Rafael Mendonça França*
628
546
 
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.
547
+ * Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`.
633
548
 
634
- Fixes #14629, #14636 and #14070.
549
+ *Rafael Mendonça França*
635
550
 
636
- *Andrew White*, *Edho Arief*
551
+ * Remove deprecated option `use_route` in controller tests.
637
552
 
638
- * Add alias `ActionDispatch::Http::UploadedFile#to_io` to
639
- `ActionDispatch::Http::UploadedFile#tempfile`.
553
+ *Rafael Mendonça França*
640
554
 
641
- *Tim Linquist*
555
+ * Ensure `append_info_to_payload` is called even if an exception is raised.
642
556
 
643
- * Returns null type format when format is not know and controller is using `any`
644
- format block.
557
+ Fixes an issue where when an exception is raised in the request the additional
558
+ payload data is not available.
645
559
 
646
- Fixes #14462.
560
+ See:
561
+ * #14903
562
+ * https://github.com/roidrage/lograge/issues/37
647
563
 
648
- *Rafael Mendonça França*
564
+ *Dieter Komendera*, *Margus Pärt*
649
565
 
650
- * Improve routing error page with fuzzy matching search.
566
+ * Correctly rely on the response's status code to handle calls to `head`.
651
567
 
652
- *Winston*
568
+ *Robin Dupret*
653
569
 
654
- * Only make deeply nested routes shallow when parent is shallow.
570
+ * Using `head` method returns empty response_body instead
571
+ of returning a single space " ".
655
572
 
656
- Fixes #14684.
573
+ The old behavior was added as a workaround for a bug in an early
574
+ version of Safari, where the HTTP headers are not returned correctly
575
+ if the response body has a 0-length. This is been fixed since and
576
+ the workaround is no longer necessary.
657
577
 
658
- *Andrew White*, *James Coglan*
578
+ Fixes #18253.
659
579
 
660
- * Append link to bad code to backtrace when exception is `SyntaxError`.
580
+ *Prathamesh Sonpatki*
661
581
 
662
- *Boris Kuznetsov*
582
+ * Fix how polymorphic routes works with objects that implement `to_model`.
663
583
 
664
- * Swapped the parameters of assert_equal in `assert_select` so that the
665
- proper values were printed correctly.
584
+ *Travis Grathwell*
666
585
 
667
- Fixes #14422.
586
+ * Stop converting empty arrays in `params` to `nil`.
668
587
 
669
- *Vishal Lal*
588
+ This behavior was introduced in response to CVE-2012-2660, CVE-2012-2694
589
+ and CVE-2013-0155
670
590
 
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.
591
+ ActiveRecord now issues a safe query when passing an empty array into
592
+ a where clause, so there is no longer a need to defend against this type
593
+ of input (any nils are still stripped from the array).
674
594
 
675
- Fixes #14388.
595
+ *Chris Sinjakli*
676
596
 
677
- *Andrew White*
597
+ * Fixed usage of optional scopes in url helpers.
678
598
 
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`.
599
+ *Alex Robbin*
682
600
 
683
- *John Barton*
601
+ * Fixed handling of positional url helper arguments when `format: false`.
684
602
 
685
- * Fix URL generation in controller tests with request-dependent
686
- `default_url_options` methods.
603
+ Fixes #17819.
687
604
 
688
- *Tony Wooster*
605
+ *Andrew White*, *Tatiana Soukiassian*
689
606
 
690
- Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md) for previous changes.
607
+ Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md) for previous changes.