Set content length for media uploads
This commit is contained in:
parent
cb8f443c66
commit
c06f4edb1e
|
@ -287,6 +287,7 @@ module Google
|
||||||
raise ArgumentError, "Can not specify body & body object for simple uploads"
|
raise ArgumentError, "Can not specify body & body object for simple uploads"
|
||||||
end
|
end
|
||||||
self.headers['Content-Type'] ||= self.media.content_type
|
self.headers['Content-Type'] ||= self.media.content_type
|
||||||
|
self.headers['Content-Length'] ||= self.media.length.to_s
|
||||||
self.body = self.media
|
self.body = self.media
|
||||||
when "multipart"
|
when "multipart"
|
||||||
unless options[:body_object]
|
unless options[:body_object]
|
||||||
|
|
Loading…
Reference in New Issue