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 cad304095..8335769eb 100644 --- a/lib/fog/aws/requests/storage/get_object_https_url.rb +++ b/lib/fog/aws/requests/storage/get_object_https_url.rb @@ -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}"]