Turistforeningen / node-s3-uploader

Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.
https://www.npmjs.com/package/s3-uploader
MIT License
241 stars 54 forks source link

Fix awsImageExpires handling #136

Closed gzurbach closed 1 year ago

gzurbach commented 7 years ago

The example in the README uses 31536000 (365 days in seconds) for both the awsImageExpires and the awsImageMaxAge options.

I concluded that passing the same value for both options would upload images with the both max-age and expires a year from now.

However, since Date.now() returns a value in milliseconds instead of seconds, we must multiply the provided value by 1000 to get the expected result. This PR addresses this issue.