aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/mime_type_test.rb
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-03-05 15:10:23 -0500
committerSteve Klabnik <steve@steveklabnik.com>2012-03-05 15:10:23 -0500
commit8c4b3a4dea79e949da583b379714a2cc4bf92ab4 (patch)
tree8dfac615db599caf04c6463073c99d609893555e /actionpack/test/dispatch/mime_type_test.rb
parent64d8d24495bfdeeccbe1908e398c2c09e2b8c0fe (diff)
downloadrails-8c4b3a4dea79e949da583b379714a2cc4bf92ab4.tar.gz
rails-8c4b3a4dea79e949da583b379714a2cc4bf92ab4.tar.bz2
rails-8c4b3a4dea79e949da583b379714a2cc4bf92ab4.zip
Added parsing of arbitrary media type parameters.
Based on #4918. Related to #4127.
Diffstat (limited to 'actionpack/test/dispatch/mime_type_test.rb')
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index 0372c42920..e3f9faaa64 100644
--- a/actionpack/test/dispatch/mime_type_test.rb
+++ b/actionpack/test/dispatch/mime_type_test.rb
@@ -75,6 +75,12 @@ class MimeTypeTest < ActiveSupport::TestCase
assert_equal expect, Mime::Type.parse(accept)
end
+ test "parse arbitarry media type parameters" do
+ accept = 'multipart/form-data; boundary="simple boundary"'
+ expect = [Mime::MULTIPART_FORM]
+ assert_equal expect, Mime::Type.parse(accept)
+ end
+
# Accept header send with user HTTP_USER_AGENT: Sunrise/0.42j (Windows XP)
test "parse broken acceptlines" do
accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/*,,*/*;q=0.5"