Browse Source

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

Aleksandr Kuzmenko 6 years ago
parent
commit
72bb18a4c0
1 changed files with 1 additions and 1 deletions
  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)
 				return;
 			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):
 				var protocol = js.Browser.location.protocol.toLowerCase();
 				var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/;