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:
parent
88e02f6e56
commit
dd6826eba3
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*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]
|
* 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]
|
* 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 "*/*", :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/html", :html, %w( application/xhtml+xml ), %w( xhtml )
|
||||||
Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript )
|
Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript )
|
||||||
Mime::Type.register "text/calendar", :ics
|
Mime::Type.register "text/calendar", :ics
|
||||||
|
|
|
@ -316,6 +316,9 @@ class RequestTest < Test::Unit::TestCase
|
||||||
@request.instance_eval { @parameters = { :format => 'xhtml' } }
|
@request.instance_eval { @parameters = { :format => 'xhtml' } }
|
||||||
assert_equal Mime::HTML, @request.format
|
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.instance_eval { @parameters = { :format => nil } }
|
||||||
@request.env["HTTP_ACCEPT"] = "text/javascript"
|
@request.env["HTTP_ACCEPT"] = "text/javascript"
|
||||||
assert_equal Mime::JS, @request.format
|
assert_equal Mime::JS, @request.format
|
||||||
|
|
Loading…
Reference in New Issue