better test for success error codes

pull/1/head
ansuz 8 years ago
parent 0b6c587e2b
commit 71dc0af6c7

@ -114,7 +114,7 @@ define([], function () {
xhr.open("GET", src, true);
xhr.responseType = "arraybuffer";
xhr.onload = function () {
if ([200, 304].indexOf(this.status) === -1) {
if (/^4/.test(''+this.status)) {
return CB('XHR_ERROR');
}
return void CB(void 0, new Uint8Array(xhr.response));

Loading…
Cancel
Save