diff --git a/client/scripts/net/http_transport.gd b/client/scripts/net/http_transport.gd index 2b53f65..dbd768c 100644 --- a/client/scripts/net/http_transport.gd +++ b/client/scripts/net/http_transport.gd @@ -31,5 +31,10 @@ func post_json(path: String, body: Dictionary) -> DmResponse: var raw: PackedByteArray = signal_args[3] if result != HTTPRequest.RESULT_SUCCESS: return DmResponse.failed("transport result %d" % result) - var parsed = JSON.parse_string(raw.get_string_from_utf8()) # null if not JSON + # Parse via JSON.new() rather than JSON.parse_string(): the latter pushes an + # engine-level error on a non-JSON body (e.g. a gateway's HTML 502), which the + # project's gutconfig promotes to a false test failure. A non-JSON body stays + # null here — the service treats a non-dict body as a failure and degrades. + var json := JSON.new() + var parsed = null if json.parse(raw.get_string_from_utf8()) != OK else json.data return DmResponse.ok(response_code, parsed)