Skip to content

Commit a981eb0

Browse files
chore: Update axios to 1.6 to pull in fix for CVE 2023 45857 (#971)
* Update axios to 1.6.0 Fixes CVE-2023-45857 * Explicit type return on Promise TypeScript's automatic type resolution for the promise returned by the function in getExponentialBackoffResponseHandler determines that it returns a Promise<unknown>. This commit forces TypeScript to recognize that the resolved object is of type Promise<AxiosResponse>. --------- Co-authored-by: Shubham <[email protected]>
1 parent e7bbeb1 commit a981eb0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"url": "https://github.com/twilio/twilio-node.git"
2121
},
2222
"dependencies": {
23-
"axios": "^0.26.1",
23+
"axios": "^1.6.0",
2424
"dayjs": "^1.11.9",
2525
"https-proxy-agent": "^5.0.0",
2626
"jsonwebtoken": "^9.0.0",

src/base/RequestClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function getExponentialBackoffResponseHandler(
5757
);
5858
const delay = Math.floor(baseDelay * Math.random()); // Full jitter backoff
5959

60-
return new Promise((resolve) => {
60+
return new Promise((resolve: (value: Promise<AxiosResponse>) => void) => {
6161
setTimeout(() => resolve(axios(config)), delay);
6262
});
6363
}

0 commit comments

Comments
 (0)