taoyuan/mqttr

Colon character (`:`) in topic causes publish to fail

kueblc opened this issue · 1 comments

Colon (":") is a special character for mqttr when subscribing to topics, but when publishing there should be no such restriction. I believe this is caused by publish being passed mqttTopic(topic) instead of topic, which transforms the colon into "+".

this.mqttclient.publish(mqttTopic(topic), this.codec.encode(message), options, cb);

As an aside, there should also be a way to escape a literal ":" when subscribing, if there isn't already.

This has been fixed in v3.0