Skip to content

Commit c06f4ed

Browse files
committed
Set content length for media uploads
1 parent cb8f443 commit c06f4ed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/google/api_client/request.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def initialize_media_upload(options)
287287
raise ArgumentError, "Can not specify body & body object for simple uploads"
288288
end
289289
self.headers['Content-Type'] ||= self.media.content_type
290+
self.headers['Content-Length'] ||= self.media.length.to_s
290291
self.body = self.media
291292
when "multipart"
292293
unless options[:body_object]

0 commit comments

Comments
 (0)