Skip to content
Browse files

processing image/* is an odditity because there is

a test case which expects image/* to not to be
expanded. So I am leaving image/* as it is and
process only text/* and application/*
  • Loading branch information...
1 parent b52a6ba commit 5c9abb6cca4b6de7146c94779a34ae943e4ea4d8 Neeraj Singh committed with josevalim Nov 25, 2010
Showing with 1 addition and 7 deletions.
  1. +1 −1 actionpack/lib/action_dispatch/http/mime_type.rb
  2. +0 −6 actionpack/test/dispatch/mime_type_test.rb
View
2 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -81,7 +81,7 @@ def ==(item)
class << self
- TRAILING_STAR_REGEXP = /(\w+)\/\*/
+ TRAILING_STAR_REGEXP = /(text|application)\/\*/
def lookup(string)
LOOKUP[string]
View
6 actionpack/test/dispatch/mime_type_test.rb
@@ -45,12 +45,6 @@ class MimeTypeTest < ActiveSupport::TestCase
assert_equal expect, parsed.sort_by(&:to_s)
end
- test "parse image with trailing star" do
- accept = "image/*"
- parsed = Mime::Type.parse(accept)
- assert parsed.include?(Mime::PNG)
- end
-
test "parse without q" do
accept = "text/xml,application/xhtml+xml,text/yaml,application/xml,text/html,image/png,text/plain,application/pdf,*/*"
expect = [Mime::HTML, Mime::XML, Mime::YAML, Mime::PNG, Mime::TEXT, Mime::PDF, Mime::ALL]

0 comments on commit 5c9abb6

Please sign in to comment.
Something went wrong with that request. Please try again.