Skip to content

Instantly share code, notes, and snippets.

@AquaGeek
Created May 14, 2011 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AquaGeek/971835 to your computer and use it in GitHub Desktop.
Save AquaGeek/971835 to your computer and use it in GitHub Desktop.
Rails Lighthouse ticket #6698
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
index 68ba1a8..8eaa085 100644
--- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb
+++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -15,10 +15,6 @@ module ActionDispatch
end
end
- def content_type
- content_mime_type && content_mime_type.to_s
- end
-
# Returns the accepted MIME type for the request.
def accepts
@env["action_dispatch.request.accepts"] ||= begin
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index f03ae7f..b6112f9 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -377,8 +377,9 @@ class RequestTest < ActiveSupport::TestCase
end
test "content type" do
- request = stub_request 'CONTENT_TYPE' => 'text/html'
+ request = stub_request 'CONTENT_TYPE' => 'text/html; charset=utf-8'
assert_equal Mime::HTML, request.content_mime_type
+ assert_equal 'utf-8', request.content_charset
end
test "can override format with parameter" do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment