Permalink
Browse files

Recognize the .txt extension as Mime::TEXT [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 88e02f6 commit dd6826eba34769d2af45d45ef91e359cd64eeb00 @technoweenie technoweenie committed Jan 12, 2007
View
@@ -1,5 +1,7 @@
*SVN*
+* Recognize the .txt extension as Mime::TEXT [Rick]
+
* Fix parsing of array[] CGI parameters so extra empty values aren't included. #6252 [Nicholas Seckar, aiwilliams, brentrowland]
* link_to_unless_current works with full URLs as well as paths. #6891 [Jarkko Laine, manfred, idrifter]
@@ -1,5 +1,5 @@
Mime::Type.register "*/*", :all
-Mime::Type.register "text/plain", :text
+Mime::Type.register "text/plain", :text, [], %w(txt)
Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml )
Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript )
Mime::Type.register "text/calendar", :ics
@@ -316,6 +316,9 @@ def test_format
@request.instance_eval { @parameters = { :format => 'xhtml' } }
assert_equal Mime::HTML, @request.format
+ @request.instance_eval { @parameters = { :format => 'txt' } }
+ assert_equal Mime::TEXT, @request.format
+
@request.instance_eval { @parameters = { :format => nil } }
@request.env["HTTP_ACCEPT"] = "text/javascript"
assert_equal Mime::JS, @request.format

0 comments on commit dd6826e

Please sign in to comment.