diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2019-06-01 16:51:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 16:51:56 +0900 |
commit | 2a015f6c0be0593a624b0c800e5335319ac4c660 (patch) | |
tree | 76458f7e7c743bdee8d979a2af83494c21f636af /guides/source/upgrading_ruby_on_rails.md | |
parent | d3e87efedb8cf9d072584bc8703841a80c07648f (diff) | |
parent | ea5f509643d6d9c468a9b26f6c45bd4e40fd67cf (diff) | |
download | rails-2a015f6c0be0593a624b0c800e5335319ac4c660.tar.gz rails-2a015f6c0be0593a624b0c800e5335319ac4c660.tar.bz2 rails-2a015f6c0be0593a624b0c800e5335319ac4c660.zip |
Merge pull request #36034 from y-yagi/fixes_35709
Change `ActionDispatch::Response#content_type` returning Content-Type header as it is
Diffstat (limited to 'guides/source/upgrading_ruby_on_rails.md')
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index b8a5c39f39..1110592d5e 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -134,6 +134,28 @@ Action Cable JavaScript API: + ActionCable.logger.enabled = false ``` +### `ActionDispatch::Response#content_type` now returned Content-Type header as it is. + +Previously, `ActionDispatch::Response#content_type` returned value does NOT contain charset part. +This behavior changed to returned Content-Type header containing charset part as it is. + +If you want just MIME type, please use `ActionDispatch::Response#media_type` instead. + +Before: + +```ruby +resp = ActionDispatch::Response.new(200, "Content-Type" => "text/csv; header=present; charset=utf-16") +resp.content_type #=> "text/csv; header=present" +``` + +After: + +```ruby +resp = ActionDispatch::Response.new(200, "Content-Type" => "text/csv; header=present; charset=utf-16") +resp.content_type #=> "text/csv; header=present; charset=utf-16" +resp.media_type #=> "text/csv" +``` + ### Autoloading The default configuration for Rails 6 |