@api private
# File lib/aws-sdk-core/plugins/s3_md5s.rb, line 28 def call(context) body = context.http_request.body if body.size > 0 context.http_request.headers['Content-Md5'] ||= md5(body) end @handler.call(context) end
# File lib/aws-sdk-core/plugins/s3_md5s.rb, line 36 def md5(body) md5 = OpenSSL::Digest::MD5.new while chunk = body.read(OneMB) md5.update(chunk) end body.rewind Base64.encode64(md5.digest).strip end