diff --git a/lib/fog/aliyun/requests/storage/get_object_http_url.rb b/lib/fog/aliyun/requests/storage/get_object_http_url.rb index 12a9b70..9b12e3d 100644 --- a/lib/fog/aliyun/requests/storage/get_object_http_url.rb +++ b/lib/fog/aliyun/requests/storage/get_object_http_url.rb @@ -22,7 +22,7 @@ def get_object_http_url_public(object, expires, options = {}) location = get_bucket_location(bucket) if acl == 'private' - expires_time = (Time.now.to_i + expires).to_s + expires_time = (Time.now.to_i + (expires.nil? ? 0 : expires.to_i)).to_s resource = bucket + '/' + object signature = sign('GET', expires_time, nil, resource) 'http://' + bucket + '.' + location + '.aliyuncs.com/' + object + diff --git a/lib/fog/aliyun/requests/storage/get_object_https_url.rb b/lib/fog/aliyun/requests/storage/get_object_https_url.rb index e1a4ae8..d7a2fb8 100644 --- a/lib/fog/aliyun/requests/storage/get_object_https_url.rb +++ b/lib/fog/aliyun/requests/storage/get_object_https_url.rb @@ -22,7 +22,7 @@ def get_object_https_url_public(object, expires, options = {}) location = get_bucket_location(bucket) if acl == 'private' - expires_time = (Time.now.to_i + expires).to_s + expires_time = (Time.now.to_i + (expires.nil? ? 0 : expires.to_i)).to_s resource = bucket + '/' + object signature = sign('GET', expires_time, nil, resource) 'https://' + bucket + '.' + location + '.aliyuncs.com/' + object +