2019-11-01 00:06:05 +00:00
|
|
|
* `respond_to#any` no longer returns a response's Content-Type based on the
|
|
|
|
request format but based on the block given.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
def my_action
|
|
|
|
respond_to do |format|
|
|
|
|
format.any { render(json: { foo: 'bar' }) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
get('my_action.csv')
|
|
|
|
```
|
|
|
|
The previous behaviour was to respond with a `text/csv` Content-Type which
|
|
|
|
is inaccurate since a JSON response is being rendered.
|
|
|
|
Now it correctly returns a `application/json` Content-Type.
|
|
|
|
|
|
|
|
* Edouard Chin*
|
|
|
|
|
2019-11-12 21:44:10 +00:00
|
|
|
* Replaces (back)slashes in failure screenshot image paths with dashes.
|
|
|
|
|
|
|
|
If a failed test case contained a slash or a backslash, a screenshot would be created in a
|
|
|
|
nested directory, causing issues with `tmp:clear`.
|
|
|
|
|
|
|
|
*Damir Zekic*
|
|
|
|
|
2019-11-19 15:03:01 +00:00
|
|
|
* Add `params.member?` to mimic Hash behavior
|
|
|
|
|
|
|
|
*Younes Serraj*
|
|
|
|
|
2019-11-04 15:30:38 +00:00
|
|
|
* `process_action.action_controller` notifications now include the following in their payloads:
|
|
|
|
|
2019-11-04 23:29:38 +00:00
|
|
|
* `:request` - the `ActionDispatch::Request`
|
2019-11-16 13:17:01 +00:00
|
|
|
* `:response` - the `ActionDispatch::Response`
|
2019-11-04 12:46:48 +00:00
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
2019-10-06 21:28:43 +00:00
|
|
|
* Updated `ActionDispatch::Request.remote_ip` setter to clear set the instance
|
|
|
|
`remote_ip` to `nil` before setting the header that the value is derived
|
|
|
|
from.
|
|
|
|
|
|
|
|
Fixes https://github.com/rails/rails/issues/37383
|
|
|
|
|
|
|
|
*Norm Provost*
|
|
|
|
|
2019-09-24 17:47:34 +00:00
|
|
|
* `ActionController::Base.log_at` allows setting a different log level per request.
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
# Use the debug level if a particular cookie is set.
|
|
|
|
class ApplicationController < ActionController::Base
|
|
|
|
log_at :debug, if: -> { cookies[:debug] }
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
2019-06-24 02:41:30 +00:00
|
|
|
* Allow system test screen shots to be taken more than once in
|
|
|
|
a test by prefixing the file name with an incrementing counter.
|
|
|
|
|
|
|
|
Add an environment variable `RAILS_SYSTEM_TESTING_SCREENSHOT_HTML` to
|
|
|
|
enable saving of HTML during a screenshot in addition to the image.
|
|
|
|
This uses the same image name, with the extension replaced with `.html`
|
|
|
|
|
|
|
|
*Tom Fakes*
|
|
|
|
|
2019-05-08 14:28:47 +00:00
|
|
|
* Add `Vary: Accept` header when using `Accept` header for response
|
|
|
|
|
|
|
|
For some requests like `/users/1`, Rails uses requests' `Accept`
|
|
|
|
header to determine what to return. And if we don't add `Vary`
|
|
|
|
in the response header, browsers might accidentally cache different
|
|
|
|
types of content, which would cause issues: e.g. javascript got displayed
|
|
|
|
instead of html content. This PR fixes these issues by adding `Vary: Accept`
|
|
|
|
in these types of requests. For more detailed problem description, please read:
|
|
|
|
|
|
|
|
https://github.com/rails/rails/pull/36213
|
|
|
|
|
|
|
|
Fixes #25842
|
|
|
|
|
|
|
|
*Stan Lo*
|
|
|
|
|
2018-10-12 06:06:13 +00:00
|
|
|
* Fix IntegrationTest `follow_redirect!` to follow redirection using the same HTTP verb when following
|
|
|
|
a 307 redirection.
|
|
|
|
|
|
|
|
*Edouard Chin*
|
|
|
|
|
2019-07-25 02:19:21 +00:00
|
|
|
* System tests require Capybara 3.26 or newer.
|
|
|
|
|
|
|
|
*George Claghorn*
|
|
|
|
|
2018-01-04 11:27:14 +00:00
|
|
|
* Reduced log noise handling ActionController::RoutingErrors.
|
|
|
|
|
|
|
|
*Alberto Fernández-Capel*
|
|
|
|
|
2019-07-10 22:33:16 +00:00
|
|
|
* Add DSL for configuring HTTP Feature Policy
|
|
|
|
|
2019-09-23 23:33:10 +00:00
|
|
|
This new DSL provides a way to configure an HTTP Feature Policy at a
|
2019-07-10 22:33:16 +00:00
|
|
|
global or per-controller level. Full details of HTTP Feature Policy
|
|
|
|
specification and guidelines can be found at MDN:
|
|
|
|
|
|
|
|
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
|
|
|
|
|
|
|
|
Example global policy
|
|
|
|
|
|
|
|
```
|
|
|
|
Rails.application.config.feature_policy do |f|
|
|
|
|
f.camera :none
|
|
|
|
f.gyroscope :none
|
|
|
|
f.microphone :none
|
|
|
|
f.usb :none
|
|
|
|
f.fullscreen :self
|
2019-07-14 21:10:22 +00:00
|
|
|
f.payment :self, "https://secure.example.com"
|
2019-07-10 22:33:16 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
Example controller level policy
|
|
|
|
|
|
|
|
```
|
|
|
|
class PagesController < ApplicationController
|
|
|
|
feature_policy do |p|
|
|
|
|
p.geolocation "https://example.com"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
*Jacob Bednarz*
|
|
|
|
|
2019-02-03 02:33:44 +00:00
|
|
|
* Add the ability to set the CSP nonce only to the specified directives.
|
|
|
|
|
|
|
|
Fixes #35137.
|
|
|
|
|
|
|
|
*Yuji Yaginuma*
|
|
|
|
|
2019-06-04 20:47:33 +00:00
|
|
|
* Keep part when scope option has value.
|
2018-12-08 21:42:40 +00:00
|
|
|
|
|
|
|
When a route was defined within an optional scope, if that route didn't
|
|
|
|
take parameters the scope was lost when using path helpers. This commit
|
|
|
|
ensures scope is kept both when the route takes parameters or when it
|
|
|
|
doesn't.
|
|
|
|
|
2019-06-04 20:47:33 +00:00
|
|
|
Fixes #33219.
|
2018-12-08 21:42:40 +00:00
|
|
|
|
|
|
|
*Alberto Almagro*
|
|
|
|
|
2019-05-17 13:13:03 +00:00
|
|
|
* Added `deep_transform_keys` and `deep_transform_keys!` methods to ActionController::Parameters.
|
|
|
|
|
|
|
|
*Gustavo Gutierrez*
|
|
|
|
|
2019-07-28 06:53:51 +00:00
|
|
|
* Calling `ActionController::Parameters#transform_keys`/`!` without a block now returns
|
2019-05-18 21:49:32 +00:00
|
|
|
an enumerator for the parameters instead of the underlying hash.
|
|
|
|
|
|
|
|
*Eugene Kenny*
|
|
|
|
|
2019-06-04 20:47:33 +00:00
|
|
|
* Fix strong parameters blocks all attributes even when only some keys are invalid (non-numerical).
|
|
|
|
It should only block invalid key's values instead.
|
2019-04-21 02:09:50 +00:00
|
|
|
|
2017-08-01 18:02:41 +00:00
|
|
|
*Stan Lo*
|
2019-04-21 02:09:50 +00:00
|
|
|
|
2019-06-04 20:47:33 +00:00
|
|
|
|
2019-04-24 19:57:14 +00:00
|
|
|
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionpack/CHANGELOG.md) for previous changes.
|