Set content length for media uploads

This commit is contained in:
Steven Bazyl 2014-01-22 15:32:35 -08:00
parent cb8f443c66
commit c06f4edb1e
1 changed files with 1 additions and 0 deletions

View File

@ -287,6 +287,7 @@ module Google
raise ArgumentError, "Can not specify body & body object for simple uploads"
end
self.headers['Content-Type'] ||= self.media.content_type
self.headers['Content-Length'] ||= self.media.length.to_s
self.body = self.media
when "multipart"
unless options[:body_object]