Generate correct date for AMZ credentials.
The old function was adding numbers together instead of strings. Convert the numbers to strings before addition.
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