diff options
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 8 | ||||
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 553f19b5bc..7f0b525f6f 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -1,4 +1,3 @@ -require 'set' require 'singleton' require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/string/starts_ends_with' @@ -95,9 +94,6 @@ to: # end # end class Type - @@html_types = Set.new [:html, :all] - cattr_reader :html_types - attr_reader :symbol @register_callbacks = [] @@ -301,7 +297,7 @@ to: end def ref - to_sym || to_s + symbol || to_s end def ===(list) @@ -328,7 +324,7 @@ to: end def html? - @@html_types.include?(to_sym) || @string =~ /html/ + symbol == :html || @string =~ /html/ end def all?; false; end diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 791c6ff625..d9fb44f06d 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -165,7 +165,7 @@ class MimeTypeTest < ActiveSupport::TestCase assert mime.respond_to?("#{type}?"), "#{mime.inspect} does not respond to #{type}?" assert_equal type, mime.symbol, "#{mime.inspect} is not #{type}?" invalid_types = types - [type] - invalid_types.delete(:html) if Mime::Type.html_types.include?(type) + invalid_types.delete(:html) invalid_types.each { |other_type| assert_not_equal mime.symbol, other_type, "#{mime.inspect} is #{other_type}?" } |