From b3f579c72dc9a0d5d73c9fab91851bc575e8f89f Mon Sep 17 00:00:00 2001 From: Timur Shemsedinov Date: Tue, 12 Oct 2021 22:24:04 +0300 Subject: [PATCH] Validation `call` identifier type Closes: https://github.com/metarhia/metacom/issues/246 PR-URL: https://github.com/metarhia/metacom/pull/257 --- CHANGELOG.md | 7 ++++--- lib/channel.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8511016f..f60e6810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,14 @@ ## [Unreleased][unreleased] - Return index.html not only from the root folder +- Fix parse broken JSON packets +- Fix detecting ping packets (empty objects) +- Fix error logging and passing to client +- Validation `call` identifier type ## [2.0.3][] - 2021-09-23 - Remove `toString` in `receiveBody` to be compatible with ws -- Fix parse broken JSON packets -- Fix detecting ping packets (empty objects) -- Fix error logging and passing to client ## [2.0.2][] - 2021-09-11 diff --git a/lib/channel.js b/lib/channel.js index 36af23da..4f8a7c08 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -102,7 +102,7 @@ class Channel { return; } const [callType, target] = Object.keys(packet); - const callId = packet[callType]; + const callId = parseInt(packet[callType], 10); const args = packet[target]; if (callId && args) { const [interfaceName, methodName] = target.split('/');