marcel/aws-s3

expires in url_for method starts from epoch time not relative to now

Opened this issue · 0 comments

url_for method requires adding current time in epoch secs + expiry time
eg:
AWS::S3::S3Object.url_for(file_name, bucket, :expires_in => Time.now.tv_usec + 60 * 30)

Documentation says otherwise

# Expiration relative to now specified in seconds

    #   # (Expires in 3 hours)
    #   S3Object.url_for('beluga_baby.jpg', 
    #                    'marcel', 
    #                    :expires_in => 60 \* 60 \* 3)