2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-24 14:04:14 +03:00

Merge pull request #440 from kenvunz/patch-2

Add exception for file protocol request
This commit is contained in:
Matt Zabriskie
2016-09-12 11:44:32 -06:00
committed by GitHub
+3 -1
View File
@@ -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;
}