We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f81f94c + 517afe2 commit 678f072Copy full SHA for 678f072
src/helpers/fetchJson.js
@@ -22,7 +22,9 @@ export default (file) => {
22
var xhr = new XMLHttpRequest()
23
xhr.onreadystatechange = function() {
24
if (xhr.readyState == XMLHttpRequest.DONE) {
25
- if (xhr.status === 200) resolve(JSON.parse(xhr.responseText))
+ // file protocol returns 0
26
+ // http(s) protocol returns 200
27
+ if (xhr.status === 0 || xhr.status === 200) resolve(JSON.parse(xhr.responseText))
28
else reject(xhr.statusText)
29
}
30
0 commit comments