Skip to content

Commit

Permalink
fix: remove non alphanumeric characters from MQTT topic names (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Oct 20, 2022
1 parent 7655d62 commit 885d8a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/util/mqtt.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ module.exports.recognize = (data) => {
}

matches.forEach((match) => {
const topic = match.name.replace(/\s+/g, '-');
const topic = match.name.replace(/\s+/g, '-').replace(/[^a-z0-9-]/gi, '');
const name = match.name.replace(/\s+/g, '_');

messages.push({
Expand Down

0 comments on commit 885d8a1

Please sign in to comment.