From 566ea6926d4ddbfafd5bc810a6ee414ae00ea7f6 Mon Sep 17 00:00:00 2001 From: Anthony Mangano Date: Tue, 15 Sep 2015 21:12:50 -0400 Subject: [PATCH] disable idempotent option when block is passed to get_object --- lib/fog/aws/requests/storage/get_object.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fog/aws/requests/storage/get_object.rb b/lib/fog/aws/requests/storage/get_object.rb index 4aee509bc..6873695d6 100644 --- a/lib/fog/aws/requests/storage/get_object.rb +++ b/lib/fog/aws/requests/storage/get_object.rb @@ -48,15 +48,17 @@ module Fog params[:headers]['If-Unmodified-Since'] = Fog::Time.at(options['If-Unmodified-Since'].to_i).to_date_header end + idempotent = true if block_given? params[:response_block] = Proc.new + idempotent = false end request(params.merge!({ :expects => [ 200, 206 ], :bucket_name => bucket_name, :object_name => object_name, - :idempotent => true, + :idempotent => idempotent, :method => 'GET', })) end