moscajs / aedes

Barebone MQTT broker that can run on any stream server, the node way
MIT License
1.78k stars 231 forks source link

[feat] Check the returned subscription in authorizeSubscribe #415

Open gnought opened 4 years ago

gnought commented 4 years ago

the returned subscription currently is checked, !sub || typeof sub !== 'object', it is better to validate also if it matches { topic: 'xxx', qos; [0|1|2|128] }

robertsLando commented 4 years ago

https://github.com/moscajs/aedes/blob/master/lib/handlers/subscribe.js#L88 https://github.com/moscajs/aedes/blob/master/lib/handlers/subscribe.js#L110