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:
parent
760cd28526
commit
ab4dbcb5f7
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue