2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

See config.responseType instead of request.responseType when suprressing DOMException

This commit is contained in:
Itaru Kitagawa
2017-01-16 14:28:38 +09:00
parent 68ec2abc4a
commit 142bce1fb0
+3 -1
View File
@@ -137,7 +137,9 @@ module.exports = function xhrAdapter(config) {
try {
request.responseType = config.responseType;
} catch (e) {
if (request.responseType !== 'json') {
// Expectes DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
if (config.responseType !== 'json') {
throw e;
}
}