global

def should_multipart?(params)

def should_multipart?(params)
  # FIXME: lifted from Rack-Test. We should push this separation upstream.
  multipart = false
  query = lambda { |value|
    case value
    when Array
      value.each(&query)
    when Hash
      value.values.each(&query)
    when Rack::Test::UploadedFile
      multipart = true
    end
  }
  params.values.each(&query)
  multipart
end