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