Skip to content

Commit

Permalink
Merge pull request #159 from drich10/master
Browse files Browse the repository at this point in the history
Use regex instead of string matching to support redirect correctly when path_style is set to true
  • Loading branch information
lanej committed Jul 31, 2015
2 parents 3ffd9fa + 6c02b47 commit cfc0b87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fog/aws/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def _request(scheme, host, port, params, original_params, &block)
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
Expand Down

0 comments on commit cfc0b87

Please sign in to comment.