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 #159 from drich10/master

Use regex instead of string matching to support redirect correctly when path_style is set to true
This commit is contained in:
Josh Lane 2015-07-31 14:36:16 -07:00
commit cfc0b87eb7

View file

@ -606,7 +606,7 @@ module Fog
Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
original_region, original_signer = @region, @signer
@region = @new_region || case new_params[:host]
when 's3.amazonaws.com', 's3-external-1.amazonaws.com'
when /s3.amazonaws.com/, /s3-external-1.amazonaws.com/
DEFAULT_REGION
else
%r{s3[\.\-]([^\.]*).amazonaws.com}.match(new_params[:host]).captures.first