[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')
end
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
['s3.amazonaws.com', "#{bucket_name}/#{object_name}"]
[@host, "#{bucket_name}/#{object_name}"]
end
http_url({
:headers => {},

View File

@ -12,9 +12,9 @@ module Fog
raise ArgumentError.new('object_name is required')
end
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
['s3.amazonaws.com', "#{bucket_name}/#{object_name}"]
[@host, "#{bucket_name}/#{object_name}"]
end
https_url({
:headers => {},