Skip to content

Commit 25f9610

Browse files
authored
chore: Fix credentials.expiration (#1434)
In the SDK credentials.expiration now needs to be a `Date` object. See: aws/aws-sdk-js-v3#5890
1 parent 590d3e2 commit 25f9610

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

karma.conf.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ function createCredentialPreprocessor() {
127127
// This will affect the generated (ES5) JS
128128
const regionCode = `var defaultRegion = '${region}';`
129129
const credentialsCode = `var credentials = ${JSON.stringify(credentials)};`
130+
// See: https://github.com/aws/aws-sdk-js-v3/issues/5890
131+
const expirationNeedsToBeDate = `credentials.expiration = new Date(credentials.expiration);`
130132
const isBrowser = `var isBrowser = true;`
131133
const contents = content.split('\n')
132134
let idx = -1
@@ -137,7 +139,7 @@ function createCredentialPreprocessor() {
137139
break
138140
}
139141
}
140-
contents.splice(idx + 1, 0, regionCode, credentialsCode, isBrowser)
142+
contents.splice(idx + 1, 0, regionCode, credentialsCode, expirationNeedsToBeDate, isBrowser)
141143
done(contents.join('\n'))
142144
}
143145
}

0 commit comments

Comments
 (0)