mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Use regex instead of string matching to support redirect correctly when path_style is set to true
- Before this change a user would get an exception because the case statement would attempt to do the else case which would get an `undefined method captures for nil class` because the region is acutally a default region Signed-off-by: Aakash Shah <ashah@pivotal.io>
This commit is contained in:
parent
3ffd9fa667
commit
6c02b477a3
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")
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue