浏览代码

[js] use local file request hack for http status only on status 0 (fixes #8268)

Aleksandr Kuzmenko 6 年之前
父节点
当前提交
72bb18a4c0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/haxe/http/HttpJs.hx

+ 1 - 1
std/haxe/http/HttpJs.hx

@@ -53,7 +53,7 @@ class HttpJs extends haxe.http.HttpBase {
 			if (r.readyState != 4)
 			if (r.readyState != 4)
 				return;
 				return;
 			var s = try r.status catch (e:Dynamic) null;
 			var s = try r.status catch (e:Dynamic) null;
-			if (s != null && js.Browser.supported) {
+			if (s == 0 && js.Browser.supported) {
 				// If the request is local and we have data: assume a success (jQuery approach):
 				// If the request is local and we have data: assume a success (jQuery approach):
 				var protocol = js.Browser.location.protocol.toLowerCase();
 				var protocol = js.Browser.location.protocol.toLowerCase();
 				var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/;
 				var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/;