Permalink
Browse files

Follow redirection from response even if response is a Hash

  • Loading branch information...
marcgg committed Feb 25, 2013
1 parent ba335ba commit c35f4affa79dea5cf520dd1c954c8f32022dfb96
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/fog/aws/storage.rb
View
@@ -400,7 +400,7 @@ def request(params, &block)
begin
response = @connection.request(params, &block)
rescue Excon::Errors::TemporaryRedirect => error
uri = URI.parse(error.response.headers['Location'])
uri = URI.parse(error.response.is_a?(Hash) ? error.response[:headers]['Location'] : error.response.headers['Location'])
Fog::Logger.warning("fog: followed redirect to #{uri.host}, connecting to the matching region will be more performant")
response = Fog::Connection.new("#{@scheme}://#{uri.host}:#{@port}", false, @connection_options).request(original_params, &block)
end

0 comments on commit c35f4af

Please sign in to comment.