mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Merge pull request #440 from kenvunz/patch-2
Add exception for file protocol request
This commit is contained in:
+3
-1
@@ -55,7 +55,9 @@ module.exports = function xhrAdapter(config) {
|
|||||||
|
|
||||||
// The request errored out and we didn't get a response, this will be
|
// The request errored out and we didn't get a response, this will be
|
||||||
// handled by onerror instead
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user