Skip to content

Commit

Permalink
Merge pull request #654 from k-italy/master
Browse files Browse the repository at this point in the history
Fixing condition of suppressing DOMException caused by XHR Level 2 Incompatible Browsers
  • Loading branch information
nickuraltsev committed Mar 2, 2017
2 parents e411b98 + b053f4b commit fe810b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/adapters/xhr.js
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit fe810b1

Please sign in to comment.