Merge pull request #34 from kyleconroy/correct-amz-credential-date
Generate correct date for AMZ credentials.
This commit is contained in:
@@ -122,8 +122,8 @@ function getS3PolicyAndSig(domain, localPadId, userId) {
|
|||||||
var expirationDate = new Date();
|
var expirationDate = new Date();
|
||||||
expirationDate.setDate(expirationDate.getDate() + 1);
|
expirationDate.setDate(expirationDate.getDate() + 1);
|
||||||
|
|
||||||
function pad(n) { return n < 10 ? '0' + n : n }
|
function pad(n) { return n < 10 ? '0' + n.toString() : n.toString() }
|
||||||
var utcDateStr = expirationDate.getUTCFullYear() +
|
var utcDateStr = pad(expirationDate.getUTCFullYear()) +
|
||||||
pad(expirationDate.getUTCMonth() + 1) +
|
pad(expirationDate.getUTCMonth() + 1) +
|
||||||
pad(expirationDate.getUTCDate());
|
pad(expirationDate.getUTCDate());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user