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

[aws|storage] direct https urls to subdomains even with dots

this may result in ssl warnings, but that seems better than the alternative (redirects)
see #611
This commit is contained in:
geemus 2012-02-27 17:39:26 -06:00
parent c0bc793ccb
commit 92b18651c7

View file

@ -11,7 +11,7 @@ module Fog
unless object_name
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]$/
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]
else
['s3.amazonaws.com', "#{bucket_name}/#{object_name}"]