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

Merge pull request #39 from greysteil/region-errors

Allow for AWS errors not specifying region
This commit is contained in:
Wesley Beary 2015-01-25 18:14:17 -06:00
commit c01c5e0817

View file

@ -590,7 +590,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