diff --git a/lib/fog/aws/requests/storage/get_object_http_url.rb b/lib/fog/aws/requests/storage/get_object_http_url.rb index e52152cc7..898e4539a 100644 --- a/lib/fog/aws/requests/storage/get_object_http_url.rb +++ b/lib/fog/aws/requests/storage/get_object_http_url.rb @@ -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 => {}, diff --git a/lib/fog/aws/requests/storage/get_object_https_url.rb b/lib/fog/aws/requests/storage/get_object_https_url.rb index 8335769eb..29368d15f 100644 --- a/lib/fog/aws/requests/storage/get_object_https_url.rb +++ b/lib/fog/aws/requests/storage/get_object_https_url.rb @@ -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 => {},