From f788b0ea94c7c037ebd63a522b2016ceb2cde72e Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 5 Jul 2011 17:57:08 -0500 Subject: [PATCH] [storage|aws] properly format modified headers in get_object closes #391 --- lib/fog/storage/requests/aws/get_object.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/fog/storage/requests/aws/get_object.rb b/lib/fog/storage/requests/aws/get_object.rb index 949b3f640..2b4ecf8c1 100644 --- a/lib/fog/storage/requests/aws/get_object.rb +++ b/lib/fog/storage/requests/aws/get_object.rb @@ -39,9 +39,13 @@ module Fog query = {'versionId' => version_id} end headers = {} - headers['If-Modified-Since'] = Fog::Time.at(options['If-Modified-Since'].to_i).to_date_header if options['If-Modified-Since'] - headers['If-Unmodified-Since'] = Fog::Time.at(options['If-Unmodified-Since'].to_i).to_date_header if options['If-Modified-Since'] headers.merge!(options) + if headers['If-Modified-Since'] + headers['If-Modified-Since'] = Fog::Time.at(headers['If-Modified-Since'].to_i).to_date_header + end + if headers['If-Unmodified-Since'] + headers['If-Unmodified-Since'] = Fog::Time.at(headers['If-Unmodified-Since'].to_i).to_date_header + end request({ :expects => [ 200, 206 ], :headers => headers,