From 11bae1fde0abb4fd054f74599939ce5a88f673c7 Mon Sep 17 00:00:00 2001 From: Steven Bazyl Date: Tue, 13 Mar 2012 14:39:44 -0700 Subject: [PATCH] Multipart upload compatibility with 1.8.7 --- lib/google/api_client/reference.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/google/api_client/reference.rb b/lib/google/api_client/reference.rb index 8575314fa..4ae201507 100644 --- a/lib/google/api_client/reference.rb +++ b/lib/google/api_client/reference.rb @@ -66,17 +66,17 @@ module Google :request => { :boundary => MULTIPART_BOUNDARY } } multipart = Faraday::Request::Multipart.new - self.body = multipart.create_multipart(env, { - :metadata => Faraday::UploadIO.new(metadata, 'application/json'), - :content => self.media}) + self.body = multipart.create_multipart(env, [ + [nil,Faraday::UploadIO.new(metadata, 'application/json', 'file.json')], + [nil, self.media]]) self.headers.update(env[:request_headers]) when "resumable" file_length = self.media.length self.headers['X-Upload-Content-Type'] = self.media.content_type - self.headers['X-Upload-Content-Length'] = file_length.to_s + self.headers['X-Upload-Content-Length'] = file_length.to_s if options[:body_object] self.headers['Content-Type'] ||= 'application/json' - self.body = serialize_body(options[:body_object]) + self.body = serialize_body(options[:body_object]) else self.body = '' end