You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I upgrade axios from 0.18.0 to 0.19.0, the requests made to fetch a local file (file:///) with a relative path return an error: Request failed with status code 0. However the web browser will always return a status code 0 when the request success because there is no HTTP server involved. The XHR readyState is also 4, if there was a network error, I believe this one would probably be 0 as well.
To Reproduce
// In a HTML file like opened at file:///tmp/axios.html for exampleaxios.get('./file.ttf',{responseType: 'arraybuffer',}).then((resp)=>{console.log('OK',resp);}).catch((err)=>{if(err.request&&err.request.readyState===4){// The response here should not be treated as an error}console.log('ERR',err);});
Expected behavior
The request should success and return the arraybuffer (works with axios 0.18.0).
Environment:
Axios Version: 0.19.0
OS: iOS 12.4, OSX 10.14.6
Browser: Safari
Browser Version: 12.1.2
Additional Library Versions: None
Additional context/Screenshots
The text was updated successfully, but these errors were encountered:
Alanscut
added a commit
to Alanscut/axios
that referenced
this issue
Oct 17, 2019
Describe the bug
Since I upgrade axios from 0.18.0 to 0.19.0, the requests made to fetch a local file (
file:///
) with a relative path return an error:Request failed with status code 0
. However the web browser will always return a status code 0 when the request success because there is no HTTP server involved. The XHR readyState is also 4, if there was a network error, I believe this one would probably be 0 as well.To Reproduce
Expected behavior
The request should success and return the arraybuffer (works with axios 0.18.0).
Environment:
Additional context/Screenshots


The text was updated successfully, but these errors were encountered: