Skip to content

Commit

Permalink
[aws][storage] storage needs to set host so that x_object_url methods…
Browse files Browse the repository at this point in the history
… will work
  • Loading branch information
geemus committed Sep 24, 2010
1 parent 760cd28 commit ab4dbcb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/fog/aws/storage.rb
Expand Up @@ -92,6 +92,18 @@ def self.reset_data(keys=data.keys)
def initialize(options={})
@aws_access_key_id = options[:aws_access_key_id]
@region = options[:region] || 'us-east-1'
@host = options[:host] || case options[:region]
when 'eu-west-1'
's3-eu-west-1.amazonaws.com'
when 'us-east-1'
's3.amazonaws.com'
when 'ap-southeast-1'
's3-ap-southeast-1.amazonaws.com'
when 'us-west-1'
's3-us-west-1.amazonaws.com'
else
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end
@data = self.class.data[@region][@aws_access_key_id]
end

Expand Down

0 comments on commit ab4dbcb

Please sign in to comment.