fix nonblocking probe rpc payload

This commit is contained in:
Codex
2026-05-25 03:34:43 +00:00
parent c4fb3d4fbf
commit 33ba51b90d
@@ -78,7 +78,7 @@ async function postRpc({ id, traceId, command }) {
accept: "application/json", accept: "application/json",
"content-type": "application/json" "content-type": "application/json"
}, },
body: JSON.stringify({ body: {
jsonrpc: "2.0", jsonrpc: "2.0",
id, id,
method: "hardware.invoke.shell", method: "hardware.invoke.shell",
@@ -99,7 +99,7 @@ async function postRpc({ id, traceId, command }) {
serviceId: "hwlab-cloud-api", serviceId: "hwlab-cloud-api",
environment: "dev" environment: "dev"
} }
}) }
}); });
} }
@@ -107,7 +107,7 @@ function requestJson(url, { method, headers = {}, body }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const target = new URL(url); const target = new URL(url);
const client = target.protocol === "https:" ? https : http; const client = target.protocol === "https:" ? https : http;
const payload = body ? JSON.stringify(body) : ""; const payload = body === undefined ? "" : JSON.stringify(body);
const request = client.request(target, { const request = client.request(target, {
method, method,
headers: { headers: {