-
Notifications
You must be signed in to change notification settings - Fork 0
[Snyk] Upgrade axios from 0.18.1 to 0.30.2 #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Snyk has created this PR to upgrade axios from 0.18.1 to 0.30.2. See this package in npm: axios See this project in Snyk: https://app.snyk.io/org/newtonombese1/project/ddd26aaf-a7df-4183-bebb-964dc17df832?utm_source=github&utm_medium=referral&page=upgrade-pr
Summary of ChangesHello @nejidevelops, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request performs a significant and necessary upgrade of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request upgrades axios from version 0.18.1 to 0.30.2. While this is an important security upgrade, it introduces a critical breaking change. Axios versions 0.19.0 and later automatically handle JSON serialization. Your current implementation in src/api/todos-api.ts manually stringifies request bodies for POST and PATCH requests. With the new axios version, this will lead to double-encoding of the JSON payload, which will likely cause your API calls to fail. I've added a detailed comment on the package.json change with information on how to resolve this issue.
| "private": true, | ||
| "dependencies": { | ||
| "axios": "^0.18.1", | ||
| "axios": "^0.30.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This upgrade to axios v0.30.2 introduces a breaking change that will likely cause your API calls to fail.
Starting with axios v0.19.0, JavaScript objects are automatically serialized to JSON for requests with Content-Type: 'application/json'. Your current code in src/api/todos-api.ts manually stringifies the data for POST and PATCH requests, for example:
// src/api/todos-api.ts:24
const response = await Axios.post(`${apiEndpoint}/todos`, JSON.stringify(newTodo), { /* ... */ });With the new axios version, this will lead to double-encoded JSON, breaking your backend integration.
To fix this, you must remove the JSON.stringify() calls in createTodo and patchTodo functions and pass the objects directly.
Example for createTodo:
// src/api/todos-api.ts
export async function createTodo(
idToken: string,
newTodo: CreateTodoRequest
): Promise<Todo> {
const response = await Axios.post(`${apiEndpoint}/todos`, newTodo, { // No JSON.stringify
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${idToken}`
}
})
return response.data.item
}The same change is needed for patchTodo. This is a critical fix required for the app to function after this dependency upgrade.
Snyk has created this PR to upgrade axios from 0.18.1 to 0.30.2.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 26 versions ahead of your current version.
The recommended version was released 24 days ago.
Issues fixed by the recommended upgrade:
SNYK-JS-ACORN-559469
SNYK-JS-ACORN-559469
SNYK-JS-AJV-584908
SNYK-JS-ANSIREGEX-1583908
SNYK-JS-SSRI-1246392
SNYK-JS-TAR-1536528
SNYK-JS-TAR-1536531
SNYK-JS-TAR-1579147
SNYK-JS-TAR-1579152
SNYK-JS-TAR-1579155
SNYK-JS-TAR-174125
SNYK-JS-TAR-1536528
SNYK-JS-TAR-1536531
SNYK-JS-TAR-1579147
SNYK-JS-TAR-1579152
SNYK-JS-TAR-1579155
SNYK-JS-TMPL-1583443
SNYK-JS-TRIM-1017038
SNYK-JS-LODASH-1040724
SNYK-JS-LODASH-450202
SNYK-JS-LODASH-567746
SNYK-JS-URLPARSE-2407770
SNYK-JS-HANDLEBARS-173692
SNYK-JS-HANDLEBARS-174183
SNYK-JS-HANDLEBARS-469063
SNYK-JS-HANDLEBARS-480388
SNYK-JS-DECODEURICOMPONENT-3149970
SNYK-JS-DNSPACKET-1293563
SNYK-JS-ELLIPTIC-571484
SNYK-JS-LODASH-1018905
SNYK-JS-URLPARSE-2412697
SNYK-JS-DOTPROP-543489
SNYK-JS-ELLIPTIC-1064899
SNYK-JS-ELLIPTIC-511941
SNYK-JS-TAR-1536758
SNYK-JS-ELLIPTIC-7577916
SNYK-JS-ELLIPTIC-7577917
SNYK-JS-ELLIPTIC-7577918
SNYK-JS-ELLIPTIC-8172694
SNYK-JS-ELLIPTIC-8720086
SNYK-JS-ESLINTUTILS-460220
SNYK-JS-FOLLOWREDIRECTS-6141137
SNYK-JS-FOLLOWREDIRECTS-6141137
SNYK-JS-HANDLEBARS-1056767
SNYK-JS-ANSIREGEX-1583908
SNYK-JS-ASYNC-2441827
SNYK-JS-AXIOS-1579269
SNYK-JS-AXIOS-6032459
SNYK-JS-BODYPARSER-7926860
SNYK-JS-EVENTSOURCE-2823375
SNYK-JS-EXPRESS-6474509
SNYK-JS-EXPRESS-7926867
SNYK-JS-FOLLOWREDIRECTS-2332181
SNYK-JS-FOLLOWREDIRECTS-6444610
SNYK-JS-FOLLOWREDIRECTS-2332181
SNYK-JS-FOLLOWREDIRECTS-6444610
SNYK-JS-HANDLEBARS-1279029
SNYK-JS-AXIOS-1038255
SNYK-JS-AXIOS-6124857
SNYK-JS-AXIOS-9292519
SNYK-JS-AXIOS-9403194
SNYK-JS-BABELHELPERS-9397697
SNYK-JS-TAR-1536758
SNYK-JS-FOLLOWREDIRECTS-2396346
SNYK-JS-FOLLOWREDIRECTS-2396346
SNYK-JS-BABELTRAVERSE-5962462
SNYK-JS-BROWSERIFYSIGN-6037026
SNYK-JS-WEBSOCKETEXTENSIONS-570623
SNYK-JS-WS-7266574
SNYK-JS-Y18N-1021887
SNYK-JS-Y18N-1021887
SNYK-JS-HANDLEBARS-534478
SNYK-JS-INI-1048974
SNYK-JS-IP-6240864
SNYK-JS-JSONSCHEMA-1920922
SNYK-JS-COLORSTRING-1082939
SNYK-JS-COOKIE-8163060
SNYK-JS-URLPARSE-1078283
SNYK-JS-URLPARSE-2401205
SNYK-JS-HANDLEBARS-567742
SNYK-JS-HTTPPROXY-569139
SNYK-JS-JQUERY-567880
SNYK-JS-PATHTOREGEXP-7925106
SNYK-JS-BRACEEXPANSION-9789073
SNYK-JS-CIPHERBASE-12084814
SNYK-JS-WS-1296835
npm:chownr:20180731
npm:mem:20180117
SNYK-JS-URLPARSE-1533425
SNYK-JS-URLPARSE-2407759
SNYK-JS-HOSTEDGITINFO-1088355
SNYK-JS-ISSVG-1085627
SNYK-JS-ISSVG-1243891
SNYK-JS-JQUERY-565129
SNYK-JS-PATHPARSE-1077067
npm:debug:20170905
npm:debug:20170905
SNYK-JS-HANDLEBARS-534988
SNYK-JS-PATHTOREGEXP-7925106
SNYK-JS-PATHTOREGEXP-8482416
SNYK-JS-PBKDF2-10495496
SNYK-JS-PBKDF2-10495498
SNYK-JS-QS-3153490
SNYK-JS-SEMVER-3247795
SNYK-JS-SEMVER-3247795
SNYK-JS-SEMVER-3247795
SNYK-JS-SEMVER-3247795
SNYK-JS-SETVALUE-1540541
SNYK-JS-SETVALUE-450213
SNYK-JS-SETVALUE-1540541
SNYK-JS-SETVALUE-450213
SNYK-JS-LODASH-608086
SNYK-JS-LODASH-6139239
SNYK-JS-MERGEDEEP-1070277
SNYK-JS-MIXINDEEP-450212
SNYK-JS-NODEFORGE-598677
SNYK-JS-POSTCSS-1090595
SNYK-JS-MINIMIST-559764
SNYK-JS-MINIMIST-559764
SNYK-JS-NODENOTIFIER-1035794
SNYK-JS-NWSAPI-2841516
SNYK-JS-ONHEADERS-10773729
SNYK-JS-SEND-7926862
SNYK-JS-SERVESTATIC-7926865
SNYK-JS-SHAJS-12089400
SNYK-JS-MINIMIST-559764
SNYK-JS-KINDOF-537849
SNYK-JS-MINIMIST-2429795
SNYK-JS-MINIMIST-2429795
SNYK-JS-MINIMIST-2429795
Release notes
Package name: axios
-
0.30.2 - 2025-09-27
- Backport
- @ FeBe95 made their first contribution in #7034
-
0.30.1 - 2025-08-04
- chore(deps): bump form-data from 4.0.0 to 4.0.4 for v0.x by @ wolandec in #6978
- @ wolandec made their first contribution in #6978
-
0.30.0 - 2025-03-26
- fix: modify log while request is aborted by @ mori5321 in #4917
- fix: update CHANGELOG.md for v0.x by @ TehZarathustra in #6271
- fix: modify upgrade guide for 0.28.1's breaking change by @ nafeger in #6787
- fix: backport allowAbsoluteUrls vulnerability fix to v0.x by @ thatguyinabeanie in #6829
- fix: add allowAbsoluteUrls type by @ thatguyinabeanie in #6849
- @ mori5321 made their first contribution in #4917
- @ TehZarathustra made their first contribution in #6271
- @ nafeger made their first contribution in #6787
- @ thatguyinabeanie made their first contribution in #6829
-
0.29.0 - 2024-11-21
-
0.28.1 - 2024-03-28
-
0.28.0 - 2024-02-12
-
0.27.2 - 2022-04-27
-
0.27.1 - 2022-04-26
-
0.27.0 - 2022-04-25
-
0.26.1 - 2022-03-09
-
0.26.0 - 2022-02-13
-
0.25.0 - 2022-01-18
-
0.24.0 - 2021-10-25
-
0.23.0 - 2021-10-12
-
0.22.0 - 2021-10-01
-
0.21.4 - 2021-09-06
-
0.21.3 - 2021-09-04
-
0.21.2 - 2021-09-04
-
0.21.1 - 2020-12-22
-
0.21.0 - 2020-10-23
-
0.20.0 - 2020-08-21
-
0.20.0-0 - 2020-07-15
-
0.19.2 - 2020-01-22
-
0.19.1 - 2020-01-07
-
0.19.0 - 2019-05-30
-
0.19.0-beta.1 - 2018-08-09
-
0.18.1 - 2019-06-01
from axios GitHub release notesWhat's Changed
maxContentLengthvulnerability fix to v0.x by @ FeBe95 in #7034New Contributors
Full Changelog: v0.30.1...v0.30.2
Release notes:
Bug Fixes
Contributors to this release
Full Changelog: v0.30.0...v0.30.1
Release notes:
Bug Fixes
Contributors to this release
Full Changelog: v0.29.0...v0.30.0
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: