Skip to content
Snippets Groups Projects
Commit dd632179 authored by capotej's avatar capotej
Browse files

make sure we rewind per read

parent 93be50bc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -93,6 +93,7 @@ module Packagecloud
 
mixed_msg = MIME::Multipart::FormData.new
 
package.file.rewind
pkg_data = MIME::Application.new(package.file.read)
pkg_data.headers.set('Content-Transfer-Encoding', 'binary')
mixed_msg.add(pkg_data, "package[package_file]", package.filename)
Loading
Loading
@@ -132,11 +133,13 @@ module Packagecloud
end
end
 
package.file.rewind
pkg_data = MIME::Application.new(package.file.read)
pkg_data.headers.set('Content-Transfer-Encoding', 'binary')
mixed_msg.add(pkg_data, "package[package_file]", package.filename)
 
package.source_files.each do |filename, io|
io.rewind
src_pkg_data = MIME::Application.new(io.read)
src_pkg_data.headers.set('Content-Transfer-Encoding', 'binary')
mixed_msg.add(src_pkg_data, "package[source_files][]", filename)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment