diff --git a/std/haxe/http/HttpJs.hx b/std/haxe/http/HttpJs.hx index 5f5eb519451..6c1b44786b7 100644 --- a/std/haxe/http/HttpJs.hx +++ b/std/haxe/http/HttpJs.hx @@ -66,7 +66,11 @@ class HttpJs extends haxe.http.HttpBase { var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/; var isLocal = rlocalProtocol.match(protocol); if (isLocal) { - s = r.response != null ? 200 : 404; + if (r.response == null || Bytes.ofData(r.response).length == 0) { + s = 404; + } else { + s = 200; + } } } if (s == js.Lib.undefined)