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:
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user