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

[storage|aws] fix hardcoded host in get_object_http(s)_url methods

This commit is contained in:
geemus 2012-03-21 17:01:39 -05:00
parent 53671afbc9
commit f78afe9824
2 changed files with 4 additions and 4 deletions

View file

@ -12,9 +12,9 @@ module Fog
raise ArgumentError.new('object_name is required') raise ArgumentError.new('object_name is required')
end end
host, path = if bucket_name =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/ host, path = if bucket_name =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
["#{bucket_name}.s3.amazonaws.com", object_name] ["#{bucket_name}.#{host}", object_name]
else else
['s3.amazonaws.com', "#{bucket_name}/#{object_name}"] [@host, "#{bucket_name}/#{object_name}"]
end end
http_url({ http_url({
:headers => {}, :headers => {},

View file

@ -12,9 +12,9 @@ module Fog
raise ArgumentError.new('object_name is required') raise ArgumentError.new('object_name is required')
end end
host, path = if bucket_name =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/ host, path = if bucket_name =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
["#{bucket_name}.s3.amazonaws.com", object_name] ["#{bucket_name}.#{@host}", object_name]
else else
['s3.amazonaws.com', "#{bucket_name}/#{object_name}"] [@host, "#{bucket_name}/#{object_name}"]
end end
https_url({ https_url({
:headers => {}, :headers => {},