提交 f9ff4e59 编写于 作者: A Aaron Patterson

ensure that content type defaults to text / html when setting charset

上级 cd8eb351
......@@ -67,6 +67,13 @@ def test_response_charset_writer
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*")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册