From 5105f61a08cc51a800d8afad21ac72b9162855b4 Mon Sep 17 00:00:00 2001 From: axbuglak Date: Fri, 8 Sep 2023 16:24:05 +0200 Subject: [PATCH 1/2] fix http response args --- src/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.js b/src/http.js index b9dc4f1..a76ed56 100644 --- a/src/http.js +++ b/src/http.js @@ -14,7 +14,7 @@ function init(server, routes) { server.post(`/api/${iface}/${method}`, async (request) => { const { query, body, headers } = request; - const response = await handler({ ...query, ...body, headers }); + const response = await handler({ query, body, headers }); return response; }); } From 6f3eb416ee8c7a3aa0f01a934bdf88923926dc93 Mon Sep 17 00:00:00 2001 From: axbuglak Date: Sat, 9 Sep 2023 23:54:02 +0200 Subject: [PATCH 2/2] fix ws connection send res --- src/ws.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ws.js b/src/ws.js index d36c13a..6336ff4 100644 --- a/src/ws.js +++ b/src/ws.js @@ -15,7 +15,7 @@ function init(server, routes) { const handler = routes?.[name]?.[method]; if (!handler) - return connection.send('"Not found"', { binary: false }); + return connection.socet.send('"Not found"', { binary: false }); const result = await handler(...args); connection.send(JSON.stringify(result), { binary: false });