diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 988419a..6dac3e7 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -55,7 +55,9 @@ module.exports = function xhrAdapter(config) { // The request errored out and we didn't get a response, this will be // handled by onerror instead - if (request.status === 0) { + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && request.responseURL.indexOf('file:') !== 0) { return; }