File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -882,7 +882,7 @@ function _require_env_var(envVarName) {
882
882
*
883
883
* @type {number }
884
884
*/
885
- var maxValidityOffsetMs = 4.5 * 60 * 100 ;
885
+ var maxValidityOffsetMs = 4.5 * 60 * 1000 ;
886
886
887
887
/**
888
888
* Get the credentials needed to create AWS signatures in order to authenticate
@@ -918,7 +918,8 @@ async function fetchCredentials(r) {
918
918
}
919
919
920
920
if ( current ) {
921
- var exp = new Date ( current . expiration ) . getTime ( ) - maxValidityOffsetMs ;
921
+ // AWS returns Unix timestamps in seconds, but in Date constructor we should provide timestamp in milliseconds
922
+ var exp = new Date ( current . expiration * 1000 ) . getTime ( ) - maxValidityOffsetMs ;
922
923
if ( now . getTime ( ) < exp ) {
923
924
r . return ( 200 ) ;
924
925
return ;
You can’t perform that action at this time.
0 commit comments