axios: Axios does not use data from config when making DELETE request
Describe the bug
Axios last version (0.20.0) does not use data from config when making DELETE request. In 0.19.2 itβs working fine
To Reproduce
axios.delete("...", {
data: { ids: [...] },
}).then(response => {
...
}).catch(error => {
...
});
Expected behavior
Axios send request data from config when making DELETE request
Environment
- Axios Version 0.20.0
- Browser Chrome
- Browser Version 84.0.4147.125
- Node.js Version 12.18.3
- OS: Linux Mint
- Additional Library Versions React 16.13.1
Additional context/Screenshots
None
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 71
- Comments: 19 (1 by maintainers)
Commits related to this issue
- fix(external): pin axios to 0.19 to avoid breaking bug in 0.20 https://github.com/axios/axios/issues/3220 — committed to wopian/kitsu by wopian 4 years ago
- fix(external): pin axios to 0.19 to avoid breaking bug in 0.20 https://github.com/axios/axios/issues/3220 — committed to wopian/kitsu by wopian 4 years ago
- Downgrade axios to 0.19 See https://github.com/axios/axios/issues/3220 — committed to nawhas/nawhas by szainmehdi 4 years ago
- Axios downgraded to 0.19.2 Wait for https://github.com/axios/axios/issues/3220 resolution — committed to karaokemugen/karaokemugen-app by Aeden-B 4 years ago
- Axios downgraded to 0.19.2 Wait for https://github.com/axios/axios/issues/3220 resolution — committed to karaokemugen/karaokemugen-app by Aeden-B 4 years ago
- fix(auth): fix security issue in authentication - revert @nestjs/common to 7.4.2 to force using axios 0.19.2 (cf. https://github.com/axios/axios/issues/3220) — committed to nohanna/swingify by nohanna 4 years ago
Iβm getting this same issue. It took a long time to figure out it was an issue with the package, this is probably a relatively urgent fix.
FYI the following is a work around until this is fixed
This seems worthy of cutting
0.20.1
to release sooner than later.This broke multiple endpoints in subtle ways for us when updating Axios and took some time to identify. I hope for the sake of other companies that this issue is resolved quickly.
Hi,
Version 0.21.0 has been released π please use that and let us know if that solves your issue.
Thanks
I also meet this problem
Tested in runkit and confirmed. It is really a breaking change.
The reason is that
mergeConfig
always selects the nextdata
. For other aliases withdata
(like post/put/patch), it is reasonable. But for aliases withoutdata
, the originalutils.merge
is better. We should fix it in the next release with some tests.@sparkxxxxxx DELETE with a body (
data
) is part of the HTTP spec.https://tools.ietf.org/html/rfc7231#section-4.3.5
Can confirm issue is fixed for us.
Kindly invite someone to test with #3282. Hope it solves the problem.
@chinesedfan I built #3282 from source and patched it into
node_modules
and our 6 failing DELETE tests that mock endpoint responses withdata
now pass π@wopian Iβm with you.
Same problem for me, I had to revert my package-lock.json to understand what was going on.