2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-21 13:24:11 +03:00
undefined is not valid JSON, make the value null instead.

JSON.parse(undefined) will throw an exception while JSON.parse(null) is acceptable.

http://stackoverflow.com/a/14946821/5012948
This commit is contained in:
Michael Bradley
2016-02-26 08:55:54 -08:00
parent dbd2c11454
commit a63e7cd8ca
+3
View File
@@ -125,6 +125,9 @@ module.exports = function xhrAdapter(resolve, reject, config) {
requestData = new DataView(requestData);
}
// Clean up request
requestData = requestData === undefined ? null : requestData;
// Send the request
request.send(requestData);
};