Skip to content

Commit

Permalink
Add MQTT spec reference in empty topic validation (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 21, 2020
1 parent a61f899 commit 1756d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/handlers/validations.js
Expand Up @@ -4,7 +4,7 @@ function validateTopic (topic, message) {
const end = topic.length - 1
const endMinus = end - 1
const slashInPreEnd = endMinus > 0 && topic.charCodeAt(endMinus) !== 47
if (topic.length === 0) {
if (topic.length === 0) { // [MQTT-3.8.3-3]
return new Error('impossible to ' + message + ' to an empty topic')
}
for (var i = 0; i < topic.length; i++) {
Expand Down

0 comments on commit 1756d68

Please sign in to comment.