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:
commit
cfc0b87eb7
1 changed files with 1 additions and 1 deletions
|
@ -606,7 +606,7 @@ module Fog
|
||||||
Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
|
Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
|
||||||
original_region, original_signer = @region, @signer
|
original_region, original_signer = @region, @signer
|
||||||
@region = @new_region || case new_params[:host]
|
@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
|
DEFAULT_REGION
|
||||||
else
|
else
|
||||||
%r{s3[\.\-]([^\.]*).amazonaws.com}.match(new_params[:host]).captures.first
|
%r{s3[\.\-]([^\.]*).amazonaws.com}.match(new_params[:host]).captures.first
|
||||||
|
|
Loading…
Add table
Reference in a new issue