Commit Graph

12 Commits

Author SHA1 Message Date
yuuji.yaginuma ea5f509643 Change `ActionDispatch::Response#content_type` returning Content-Type header as it is
Since #35709, `Response#conten_type` returns only MIME type correctly.
It is a documented behavior that this method only returns MIME type, so
this change seems appropriate.
39de7fac05/actionpack/lib/action_dispatch/http/response.rb (L245-L249)

But unfortunately, some users expect this method to return all
Content-Type that does not contain charset. This seems to be breaking
changes.

We can change this behavior with the deprecate cycle.
But, in that case, a method needs that include Content-Type with
additional parameters. And that method name is probably the
`content_type` seems to properly.

So I changed the new behavior to more appropriate `media_type` method.
And `Response#content_type` changed (as the method name) to return Content-Type
header as it is.

Fixes #35709.

[Rafael Mendonça França & Yuuji Yaginuma ]
2019-06-01 09:20:13 +09:00
Kir Shatrov dfcc766163 Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Xavier Noria 35b3de8021 applies new string literal convention in actionpack/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:54:50 +02:00
robertomiranda ce8efcf296 Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
2015-01-31 23:12:41 -05:00
Tu Hoang 8ef51f64e5 Typo: Hello = Guten Tag (in German) 2014-12-05 12:54:15 +07:00
Zuhao Wan 1407315423 Move I18n.locale setting into setup and teardown. 2014-05-28 21:50:30 +08:00
Angelo capilleri 43962d6ec5 Fix header Content-Type: #<Mime::NullType:...> in localized template
This PR fixes #13064 regression bug introduced by the #8085

Now in _process_format when the format is a Mime::NullType nothing is written in self.content_type.
In this way the method Response#assign_default_content_type_and_charset can
write the the default mime_type.
2013-12-03 07:46:39 +01:00
Juan Barreneche cecbf5dd4d Include I18n fallbacks in :locale lookup context 2013-03-16 21:27:13 -03:00
Akira Matsuda 9b520d31e5 Restore I18n.locale after running tests 2013-01-22 10:26:44 +09:00
Carl Lerche 99d5459921 Fixed that default locale templates should be used if the current locale template is missing [DHH] 2010-04-08 18:11:26 -07:00