aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-05-23 00:39:32 -0700
committerYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-05-23 00:39:32 -0700
commite22a3d893ef8441fb52320315c5e348c6c208b69 (patch)
treeefdbc4f2bece84bf500284a4a8dce9a7ef839324 /actionpack/lib/action_dispatch/http/request.rb
parent3ac6d8f8b01fb04b8d6d35d75d802b41f4c256c9 (diff)
downloadrails-e22a3d893ef8441fb52320315c5e348c6c208b69.tar.gz
rails-e22a3d893ef8441fb52320315c5e348c6c208b69.tar.bz2
rails-e22a3d893ef8441fb52320315c5e348c6c208b69.zip
Slightly modify things to get content type matching working without breaking other code
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rwxr-xr-xactionpack/lib/action_dispatch/http/request.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 4831b89bde..259164d118 100755
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -173,9 +173,15 @@ module ActionDispatch
def formats
if ActionController::Base.use_accept_header
- Array(Mime[parameters[:format]] || accepts)
+ ret = Array(Mime[parameters[:format]] || accepts)
+ if defined?(ActionController::Http)
+ if all = ret.index(Mime::ALL)
+ ret.delete(Mime::ALL) && ret.insert(all, *Mime::SET)
+ end
+ end
+ ret
else
- [format, Mime[:all]]
+ [format] + Mime::SET
end
end