diff --git a/lib/fog/storage/google_xml/requests/get_object_http_url.rb b/lib/fog/storage/google_xml/requests/get_object_http_url.rb index 23f934bd56..a525a3b730 100644 --- a/lib/fog/storage/google_xml/requests/get_object_http_url.rb +++ b/lib/fog/storage/google_xml/requests/get_object_http_url.rb @@ -6,12 +6,11 @@ def get_object_http_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name raise ArgumentError.new("object_name is required") unless object_name - https_url(options.merge(:headers => {}, - :host => @host, - :method => "GET", - :path => "#{bucket_name}/#{object_name}"), + http_url(options.merge(:headers => {}, + :host => @host, + :method => "GET", + :path => "#{bucket_name}/#{object_name}"), expires) - http_url(url_options, expires) end end diff --git a/lib/fog/storage/google_xml/requests/get_object_https_url.rb b/lib/fog/storage/google_xml/requests/get_object_https_url.rb index fa9639854e..c6c6f2c7c9 100644 --- a/lib/fog/storage/google_xml/requests/get_object_https_url.rb +++ b/lib/fog/storage/google_xml/requests/get_object_https_url.rb @@ -2,7 +2,7 @@ module Fog module Storage class GoogleXML module GetObjectHttpsUrl - def get_object_https_url(bucket_name, object_name, expires, options) + def get_object_https_url(bucket_name, object_name, expires, options = {}) raise ArgumentError.new("bucket_name is required") unless bucket_name raise ArgumentError.new("object_name is required") unless object_name diff --git a/test/unit/storage/test_xml_requests.rb b/test/unit/storage/test_xml_requests.rb index 402b318a58..f8e0d83ae8 100644 --- a/test/unit/storage/test_xml_requests.rb +++ b/test/unit/storage/test_xml_requests.rb @@ -12,6 +12,22 @@ def teardown Fog.unmock! end + def test_get_http_url + url = @client.get_object_http_url("bucket", + "just some file.json", + Time.now + 2 * 60) + assert_match(/^http:\/\//, url, + "URL starts with HTTP") + end + + def test_get_https_url + url = @client.get_object_https_url("bucket", + "just some file.json", + Time.now + 2 * 60) + assert_match(/^https:\/\//, url, + "URL starts with HTTPS") + end + def test_get_url_path_has_query_params url = @client.get_object_url("bucket", "just some file.json",