Skip to content

Commit

Permalink
Ruby1.9 compat
Browse files Browse the repository at this point in the history
String doesn't respond to #any? anymore, because
Enumerable is no more included in it.
  • Loading branch information
sr committed May 8, 2009
1 parent 8dcfbe4 commit 9de9fbd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rack/test.rb
Expand Up @@ -150,9 +150,8 @@ def env_for(path, env)
if (env[:method] == "POST" || env["REQUEST_METHOD"] == "POST") && !env.has_key?(:input)
env["CONTENT_TYPE"] = "application/x-www-form-urlencoded"

multipart = (env[:params] || {}).any? do |k, v|
UploadedFile === v
end
multipart = (Hash === env[:params]) &&
env[:params].any? { |_, v| UploadedFile === v }

if multipart
env[:input] = multipart_body(env.delete(:params))
Expand Down

0 comments on commit 9de9fbd

Please sign in to comment.