2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

Merge pull request #654 from k-italy/master

Fixing condition of suppressing DOMException caused by XHR Level 2 Incompatible Browsers
This commit is contained in:
Nick Uraltsev
2017-03-01 22:55:07 -08:00
committed by GitHub
+3 -1
View File
@@ -137,7 +137,9 @@ module.exports = function xhrAdapter(config) {
try {
request.responseType = config.responseType;
} catch (e) {
if (request.responseType !== 'json') {
// Expected 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;
}
}