Skip to content

Commit

Permalink
[s3] matching version_id related fix for head_object
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed May 14, 2010
1 parent 7984ad4 commit de24096
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/fog/aws/requests/s3/head_object.rb
Expand Up @@ -25,7 +25,15 @@ class Real
# * 'ETag'<~String> - Etag of object
# * 'Last-Modified'<~String> - Last modified timestamp for object
def head_object(bucket_name, object_name, options={})
version_id = options.delete('versionId')
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
unless object_name
raise ArgumentError.new('object_name is required')
end
if version_id = options.delete('versionId')
query = CGI.escape(version_id)
end
headers = {}
headers['If-Modified-Since'] = options['If-Modified-Since'].utc.strftime("%a, %d %b %Y %H:%M:%S +0000") if options['If-Modified-Since']
headers['If-Unmodified-Since'] = options['If-Unmodified-Since'].utc.strftime("%a, %d %b %Y %H:%M:%S +0000") if options['If-Modified-Since']
Expand Down

0 comments on commit de24096

Please sign in to comment.