2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-30 15:24:11 +03:00

Fix - Request ignores false, 0 and empty string as body values (#4785)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
visortelle
2022-06-14 21:56:17 +02:00
committed by GitHub
parent e518c5da1b
commit 5ba3f787c4
+2 -1
View File
@@ -205,7 +205,8 @@ module.exports = function xhrAdapter(config) {
}
}
if (!requestData) {
// false, 0 (zero number), and '' (empty string) are valid JSON values
if (!requestData && requestData !== false && requestData !== 0 && requestData !== '') {
requestData = null;
}