From f78afe98242a60ae4dbbfcd8c5ab67ba71c6d773 Mon Sep 17 00:00:00 2001 From: geemus Date: Wed, 21 Mar 2012 17:01:39 -0500 Subject: [PATCH] [storage|aws] fix hardcoded host in get_object_http(s)_url methods --- lib/fog/aws/requests/storage/get_object_http_url.rb | 4 ++-- lib/fog/aws/requests/storage/get_object_https_url.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 => {},