Skip to content

Commit

Permalink
Fix - Request ignores false, 0 and empty string as body values (#4785)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
visortelle and jasonsaayman committed Jun 14, 2022
1 parent e518c5d commit 5ba3f78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/adapters/xhr.js
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5ba3f78

Please sign in to comment.