Permalink
Browse files

Sets the HTTP charset parameter for rescue response.

  • Loading branch information...
1 parent c7f7a45 commit 49b825e502d57f10aa2cee10c1d631a95f3cef64 @matiaskorhonen matiaskorhonen committed May 3, 2011
@@ -116,7 +116,7 @@ def status_code(exception)
end
def render(status, body)
- [status, {'Content-Type' => 'text/html', 'Content-Length' => body.bytesize.to_s}, [body]]
+ [status, {'Content-Type' => "text/html; charset=#{Response.default_charset}", 'Content-Length' => body.bytesize.to_s}, [body]]
end
def public_path
@@ -137,4 +137,11 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest
assert_response 500
assert_match(/RuntimeError\n in FeaturedTilesController/, body)
end
+
+ test "sets the HTTP charset parameter" do
+ @app = DevelopmentApp
+
+ get "/", {}, {'action_dispatch.show_exceptions' => true}
+ assert_equal "text/html; charset=utf-8", response.headers["Content-Type"]
+ end
end

0 comments on commit 49b825e

Please sign in to comment.