From 71dc0af6c76a4ab04040070a11e44fc41cb5611d Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 May 2017 14:37:57 +0200 Subject: [PATCH] better test for success error codes --- www/common/common-util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/common-util.js b/www/common/common-util.js index f04b85199..6fb2ad7bb 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -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));