From 73fbf7771bbfc6c3c8c4ddd8f4f84eb6bfac504d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 15 May 2007 23:57:16 +0000 Subject: Add multipart and url-encoded form mime types. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/mime_types.rb | 3 +++ actionpack/test/controller/mime_type_test.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/mime_types.rb b/actionpack/lib/action_controller/mime_types.rb index 8273a2403b..71706b4c41 100644 --- a/actionpack/lib/action_controller/mime_types.rb +++ b/actionpack/lib/action_controller/mime_types.rb @@ -13,5 +13,8 @@ Mime::Type.register "application/rss+xml", :rss Mime::Type.register "application/atom+xml", :atom Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml ) +Mime::Type.register "multipart/form-data", :multipart_form +Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form + # http://www.ietf.org/rfc/rfc4627.txt Mime::Type.register "application/json", :json, %w( text/x-json ) diff --git a/actionpack/test/controller/mime_type_test.rb b/actionpack/test/controller/mime_type_test.rb index 1c944697d4..ed8f0357f4 100644 --- a/actionpack/test/controller/mime_type_test.rb +++ b/actionpack/test/controller/mime_type_test.rb @@ -39,7 +39,7 @@ class MimeTypeTest < Test::Unit::TestCase end def test_type_convenience_methods - types = [:html, :xml, :png, :pdf, :yaml] + types = [:html, :xml, :png, :pdf, :yaml, :url_encoded_form] types.each do |type| mime = Mime.const_get(type.to_s.upcase) assert mime.send("#{type}?"), "Mime::#{type.to_s.upcase} is not #{type}?" @@ -51,4 +51,4 @@ class MimeTypeTest < Test::Unit::TestCase assert Mime::ALL.all?, "Mime::ALL is not all?" assert Mime::ALL.html?, "Mime::ALL is not html?" end -end \ No newline at end of file +end -- cgit v1.2.3