From a3245b3a84cb7a2fb6373eaf73856fc429296da2 Mon Sep 17 00:00:00 2001 From: Kevin Menard Date: Tue, 28 Feb 2012 14:25:02 -0500 Subject: [PATCH] [aws|storage|test] Replaced random ETag implementation with MD5, per S3 docs. --- lib/fog/aws.rb | 4 ---- lib/fog/aws/requests/storage/put_object.rb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/fog/aws.rb b/lib/fog/aws.rb index 520a6c0cc..213f656b3 100644 --- a/lib/fog/aws.rb +++ b/lib/fog/aws.rb @@ -131,10 +131,6 @@ module Fog "ip-#{ip_address.gsub('.','-')}.ec2.internal" end - def self.etag - Fog::Mock.random_hex(32) - end - def self.image path = [] (rand(3) + 2).times do diff --git a/lib/fog/aws/requests/storage/put_object.rb b/lib/fog/aws/requests/storage/put_object.rb index 67094a426..0b05d7ecd 100644 --- a/lib/fog/aws/requests/storage/put_object.rb +++ b/lib/fog/aws/requests/storage/put_object.rb @@ -66,7 +66,7 @@ module Fog object = { :body => data[:body], 'Content-Type' => options['Content-Type'] || data[:headers]['Content-Type'], - 'ETag' => Fog::AWS::Mock.etag, + 'ETag' => Digest::MD5.hexdigest(data[:body]), 'Key' => object_name, 'Last-Modified' => Fog::Time.now.to_date_header, 'Content-Length' => options['Content-Length'] || data[:headers]['Content-Length'],