mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ensure that content type defaults to text / html when setting charset
This commit is contained in:
parent
cd8eb351fb
commit
f9ff4e591e
1 changed files with 7 additions and 0 deletions
|
@ -67,6 +67,13 @@ class ResponseTest < ActiveSupport::TestCase
|
|||
assert_equal 200, ActionDispatch::Response.new('200 OK').status
|
||||
end
|
||||
|
||||
def test_only_set_charset_still_defaults_to_text_html
|
||||
response = ActionDispatch::Response.new
|
||||
response.charset = "utf-16"
|
||||
_,headers,_ = response.to_a
|
||||
assert_equal "text/html; charset=utf-16", headers['Content-Type']
|
||||
end
|
||||
|
||||
test "utf8 output" do
|
||||
@response.body = [1090, 1077, 1089, 1090].pack("U*")
|
||||
|
||||
|
|
Loading…
Reference in a new issue