lib/rubygems/commands/inabox_command.rb in geminabox-0.2.0 vs lib/rubygems/commands/inabox_command.rb in geminabox-0.2.1
- old
+ new
@@ -70,12 +70,10 @@
f.write config.to_yaml
end
end
module Multipart
- require 'rubygems'
- require 'mime/types'
require 'net/http'
require 'cgi'
class Param
attr_accessor :k, :v
@@ -96,10 +94,10 @@
@filename = filename
@content = content
end
def to_multipart
- return "Content-Disposition: form-data; name=\"#{k}\"; filename=\"#{filename}\"\r\n" + "Content-Transfer-Encoding: binary\r\n" + "Content-Type: #{MIME::Types.type_for(@filename)}\r\n\r\n" + content + "\r\n"
+ return "Content-Disposition: form-data; name=\"#{k}\"; filename=\"#{filename}\"\r\n" + "Content-Transfer-Encoding: binary\r\n" + "Content-Type: application/octet-stream\r\n\r\n" + content + "\r\n"
end
end
class MultipartPost
BOUNDARY = 'tarsiers-rule0000'