mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Follow redirection from response even if response is a Hash
This commit is contained in:
parent
ba335baf48
commit
c35f4affa7
1 changed files with 1 additions and 1 deletions
|
@ -400,7 +400,7 @@ DATA
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue