fix nonblocking probe rpc payload
This commit is contained in:
@@ -78,7 +78,7 @@ async function postRpc({ id, traceId, command }) {
|
||||
accept: "application/json",
|
||||
"content-type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
body: {
|
||||
jsonrpc: "2.0",
|
||||
id,
|
||||
method: "hardware.invoke.shell",
|
||||
@@ -99,7 +99,7 @@ async function postRpc({ id, traceId, command }) {
|
||||
serviceId: "hwlab-cloud-api",
|
||||
environment: "dev"
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ function requestJson(url, { method, headers = {}, body }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const target = new URL(url);
|
||||
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, {
|
||||
method,
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user