mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +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:
@@ -125,6 +125,9 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
|||||||
requestData = new DataView(requestData);
|
requestData = new DataView(requestData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up request
|
||||||
|
requestData = requestData === undefined ? null : requestData;
|
||||||
|
|
||||||
// Send the request
|
// Send the request
|
||||||
request.send(requestData);
|
request.send(requestData);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user