mirror of
https://github.com/photonstorm/phaser
synced 2024-12-17 08:33:40 +00:00
Only allow XHR status 0 for local file:// URLs
Since 0 can also be an error situation, limit the amount we okay it.
This commit is contained in:
parent
44f9b10e8c
commit
7d84b54239
1 changed files with 4 additions and 1 deletions
|
@ -315,7 +315,10 @@ var File = new Class({
|
|||
*/
|
||||
onLoad: function (xhr, event)
|
||||
{
|
||||
var success = !(event.target && (event.target.status !== 200 && event.target.status !== 0));
|
||||
var localFileOk = xhr.responseURL.indexOf('file://') == 0 &&
|
||||
event.target.status === 0;
|
||||
|
||||
var success = !(event.target && event.target.status !== 200) || localFileOk;
|
||||
|
||||
// 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)
|
||||
|
|
Loading…
Reference in a new issue