From 7617430a3ff6b9f037930662b3157b60f1af3919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dalfors?= Date: Sat, 18 May 2024 21:42:25 +0200 Subject: [PATCH] fix regex --- backend/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 0502ae3..7e597e3 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -49,7 +49,7 @@ export class ConnectionManager { let decoded_payload = null // spell-checker: disable-next-line - if (topic.match(/spBv1\.0\/[^/]+\/(DDATA|NDATA|NCMD|DCMD|NBIRTH|DBIRTH|NDEATH|DDEATH\/[^/]+\/)/u)) { + if (topic.match(/^spBv1\.0\/[^/]+\/[ND](DATA|CMD|DEATH|BIRTH)\/[^/]+(\/[^/]+)?$/u)) { decoded_payload = SparkplugDecoder.decode(buffer) } else { decoded_payload = Base64Message.fromBuffer(buffer)