Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove select, collect and then inject with

something better

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 794b34306eea0c7e1e99f5741df16129e8e22b3f 1 parent c5bfc6a
Neeraj Singh neerajdotname authored josevalim committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_dispatch/http/mime_type.rb
2  actionpack/lib/action_dispatch/http/mime_type.rb
View
@@ -175,7 +175,7 @@ def parse(accept_header)
# returend value: [Mime::HTML, Mime::JS, Mime::XML, Mime::YAML, Mime::ATOM, Mime::JSON, Mime::RSS, Mime::URL_ENCODED_FORM
def parse_data_with_trailing_star(input)
keys = Mime::LOOKUP.keys.select{|k| k.include?(input)}
- Mime::LOOKUP.select {|k,_| keys.include?(k)}.collect{|i| i[1]}.inject([]){|all,e| all.include?(e) ? all : all << e}
+ Mime::LOOKUP.values_at(*keys).uniq
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.