1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

Allow for AWS errors not specifying region

This commit is contained in:
Grey Baker 2015-01-24 11:46:17 +00:00
parent 18d86f822c
commit 29fbda675f

View file

@ -554,7 +554,7 @@ module Fog
new_params[:bucket_name] = %r{<Bucket>([^<]*)</Bucket>}.match(body).captures.first
new_params[:host] = %r{<Endpoint>([^<]*)</Endpoint>}.match(body).captures.first
# some errors provide it directly
@new_region = %r{<Region>([^<]*)</Region>}.match(body).captures.first
@new_region = %r{<Region>([^<]*)</Region>}.match(body) ? Regexp.last_match.captures.first : nil
end
Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
original_region, original_signer = @region, @signer