From 0083e310c3c41f5564e7eaa13676e85d2bfba3b0 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Apr 2025 21:02:38 +0200 Subject: [PATCH 1/2] Update HttpJs.hx Even though there was no data, the status would be 200 --- std/haxe/http/HttpJs.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/std/haxe/http/HttpJs.hx b/std/haxe/http/HttpJs.hx index 5f5eb519451..7592779c081 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) From 3cfc25a7291c7082c5984d420ee26b95e37102f0 Mon Sep 17 00:00:00 2001 From: M Date: Sat, 5 Apr 2025 21:08:18 +0200 Subject: [PATCH 2/2] Formatting --- std/haxe/http/HttpJs.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/haxe/http/HttpJs.hx b/std/haxe/http/HttpJs.hx index 7592779c081..6c1b44786b7 100644 --- a/std/haxe/http/HttpJs.hx +++ b/std/haxe/http/HttpJs.hx @@ -66,7 +66,7 @@ class HttpJs extends haxe.http.HttpBase { var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/; var isLocal = rlocalProtocol.match(protocol); if (isLocal) { - if (r.response == null || Bytes.ofData(r.response).length == 0 ) { + if (r.response == null || Bytes.ofData(r.response).length == 0) { s = 404; } else { s = 200;