Skip to content

Commit

Permalink
Merge pull request #892 from olleolleolle/fix/drop-ruby-18-compat
Browse files Browse the repository at this point in the history
Multipart: Drop Ruby 1.8 String behavior compat
  • Loading branch information
technoweenie committed Feb 27, 2019
2 parents bbf937d + 7bfac0c commit 94f4175
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/faraday/request/multipart.rb
Expand Up @@ -35,8 +35,7 @@ def process_request?(env)
# @param obj [Object]
# @return [Boolean]
def has_multipart?(obj)
# string is an enum in 1.8, returning list of itself
if obj.respond_to?(:each) && !obj.is_a?(String)
if obj.respond_to?(:each)
(obj.respond_to?(:values) ? obj.values : obj).each do |val|
return true if (val.respond_to?(:content_type) || has_multipart?(val))
end
Expand Down

0 comments on commit 94f4175

Please sign in to comment.