-
-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Description
The defaultExpireTime uses the local time as do the examples in the docs. If you're ahead of UTC (e.g most of Europe) the links are expired as you create them. If you're behind UTC (e.g. all of USA) the links is valid longer than you think.
aws-cloudfront-sign/lib/cloudfrontUtil.js
Line 141 in a8d5579
| var defaultExpireTime = Math.round(Date.now() + 1800000); |
There is not a really nice way in JavaScript without resorting to Moment.js or the like. https://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc
var now = new Date();
var nowUTC = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
var defaultExpireTime = Math.round(nowUTC.getTime() + 1800000);Moment.js
moment().utc().add(1, 'day'){"AWS:EpochTime":required ending date and time in Unix time format and UTC}
Mattchewone, ky-cheng and crissdev
Metadata
Metadata
Assignees
Labels
No labels
