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)