From 44f9b10e8cdb8faa124a9cc3a26439b13debe413 Mon Sep 17 00:00:00 2001 From: "Ithamar R. Adema" Date: Wed, 25 Jul 2018 09:54:50 +0200 Subject: [PATCH] Allow XHR status 0 as success too Normally only status 200 would be accepted as success, but 0 is returned when a file is loaded from the local filesystem (file://). This happens for example when opening the index.html of a (Phaser) game in a browser directly, or, as it turns out, when using Cordova on iOS. This fixes #3464 --- src/loader/File.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loader/File.js b/src/loader/File.js index e2daa724e..343782244 100644 --- a/src/loader/File.js +++ b/src/loader/File.js @@ -315,7 +315,7 @@ var File = new Class({ */ onLoad: function (xhr, event) { - var success = !(event.target && event.target.status !== 200); + var success = !(event.target && (event.target.status !== 200 && event.target.status !== 0)); // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)