From d88547799c148176bd252c809f43e33c18c0f185 Mon Sep 17 00:00:00 2001 From: Tal Yalon Date: Mon, 2 May 2011 23:11:47 +0300 Subject: [PATCH] Issue #283: S3 get_object request doesn't really support the Range header Now if a Range header exists we also expect HTTP status 206. --- lib/fog/storage/requests/aws/get_object.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/storage/requests/aws/get_object.rb b/lib/fog/storage/requests/aws/get_object.rb index 083148f94..3d87e973a 100644 --- a/lib/fog/storage/requests/aws/get_object.rb +++ b/lib/fog/storage/requests/aws/get_object.rb @@ -43,7 +43,7 @@ module Fog headers['If-Unmodified-Since'] = Fog::Time.at(options['If-Unmodified-Since'].to_i).to_date_header if options['If-Modified-Since'] headers.merge!(options) request({ - :expects => 200, + :expects => headers.include?('Range') ? [ 200, 206 ] : 200, :headers => headers, :host => "#{bucket_name}.#{@host}", :idempotent => true,