lib/httpx/transcoder/multipart/encoder.rb in httpx-1.2.4 vs lib/httpx/transcoder/multipart/encoder.rb in httpx-1.2.6
- old
+ new
@@ -17,10 +17,10 @@
def content_type
"multipart/form-data; boundary=#{@boundary}"
end
def read(length = nil, outbuf = nil)
- data = outbuf.clear.force_encoding(Encoding::BINARY) if outbuf
+ data = String(outbuf).clear.force_encoding(Encoding::BINARY) if outbuf
data ||= "".b
read_chunks(data, length)
data unless length && data.empty?