We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a7512 commit 214bfedCopy full SHA for 214bfed
common/etc/nginx/include/s3gateway.js
@@ -988,8 +988,9 @@ async function fetchCredentials(r) {
988
}
989
990
if (current) {
991
- // AWS returns Unix timestamps in seconds, but in Date constructor we should provide timestamp in milliseconds
992
- const exp = new Date(current.expiration * 1000).getTime() - maxValidityOffsetMs;
+ // If AWS returns a Unix timestamp it will be in seconds, but in Date constructor we should provide timestamp in milliseconds
+ const expireAt = typeof current.expiration == 'number' ? current.expiration * 1000 : current.expiration
993
+ const exp = new Date(expireAt).getTime() - maxValidityOffsetMs;
994
if (NOW.getTime() < exp) {
995
r.return(200);
996
return;
0 commit comments