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

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson 2007-01-12 20:54:04 +00:00
parent 88e02f6e56
commit dd6826eba3
3 changed files with 6 additions and 1 deletions

View File

@ -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]

View File

@ -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

View File

@ -316,6 +316,9 @@ class RequestTest < Test::Unit::TestCase
@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