diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:46 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:46 -0500 |
commit | 12288a034120e8b1f90fcd4ae5881a858fd1425e (patch) | |
tree | cea73e54bc6266b8d949ee421c68336d1e50da49 /actionpack/lib | |
parent | 926f4648f0628009336c44f4d31019819434e39c (diff) | |
parent | f48e89931f3dfe0571f62f926c01cb7783814347 (diff) | |
download | rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.tar.gz rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.tar.bz2 rails-12288a034120e8b1f90fcd4ae5881a858fd1425e.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/mime_type.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/mime_type.rb b/actionpack/lib/action_controller/mime_type.rb index 16e3ffc9c1..8c02f20521 100644 --- a/actionpack/lib/action_controller/mime_type.rb +++ b/actionpack/lib/action_controller/mime_type.rb @@ -71,8 +71,11 @@ module Mime # keep track of creation order to keep the subsequent sort stable list = [] accept_header.split(/,/).each_with_index do |header, index| - params = header.split(/;\s*q=/) - list << AcceptItem.new(index, *params) unless params.empty? + params, q = header.split(/;\s*q=/) + if params + params.strip! + list << AcceptItem.new(index, params, q) unless params.empty? + end end list.sort! @@ -145,7 +148,7 @@ module Mime end def ==(mime_type) - return false unless mime_type + return false if mime_type.blank? (@synonyms + [ self ]).any? do |synonym| synonym.to_s == mime_type.to_s || synonym.to_sym == mime_type.to_sym end |