- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 354
 
Closed
Description
In this example, the bucket "jrem-test" has been created in the us-east-1 region.
>> Fog::Storage.new({provider: "AWS", region: "us-east-1"}).directories.get("jrem-test").location
"us-east-1"
as you'd expect. However, connecting via another region gives a different answer:
Fog::Storage.new({provider: "AWS", region: "eu-west-1"}).directories.get("jrem-test").location
[fog][WARNING] fog: followed redirect to jrem-test.s3-eu-west-1.amazonaws.com, connecting to the matching region will be more performant
"eu-west-1"
(Some operations on the bucket using the latter connection work fine, but (for example) directory.files.all throws an error complaining that the wrong region was used; creating some new objects fails with an error that suggests Fog isn't following redirects correctly - which is probably another issue).
I think the problem lies in lib/fog/aws/models/storage/directory.rb:34, where if no location constraint is set on an object, the region of the connection is used. I think this should instead use the AWS default region.
suhovius
Metadata
Metadata
Assignees
Labels
No labels