1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws][storage] storage needs to set host so that x_object_url methods will work

This commit is contained in:
geemus 2010-09-24 14:36:42 -07:00
parent 760cd28526
commit ab4dbcb5f7

View file

@ -92,6 +92,18 @@ module Fog
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