Skip to content

Commit

Permalink
ensure content-length header value is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Sep 7, 2010
1 parent bc2cd52 commit a13e6a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/faraday/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create_multipart(env, params, boundary = nil)
boundary ||= env[:request][:boundary]
parts = params.map {|k,v| Faraday::Parts::Part.new(boundary, k, v)}
parts << Faraday::Parts::EpiloguePart.new(boundary)
env[:request_headers]['Content-Length'] = parts.inject(0) {|sum,i| sum + i.length }
env[:request_headers]['Content-Length'] = parts.inject(0) {|sum,i| sum + i.length }.to_s
Faraday::CompositeReadIO.new(*parts.map{|p| p.to_io })
end

Expand Down

0 comments on commit a13e6a2

Please sign in to comment.