mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-27 13:48:49 +08:00
Fix regexp for SUB (#557)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
This commit is contained in:
parent
2c6379f823
commit
0b770ce49e
@ -149,7 +149,7 @@ aedes.authorizePublish = function (client, packet, publish) {
|
||||
aedes.authorizeSubscribe = function (client, packet, subscribe) {
|
||||
// Topics are in the form `channels/<channel_id>/messages`
|
||||
// Subtopic's are in the form `channels/<channel_id>/messages/<subtopic>`
|
||||
var channel = /^channels\/(.+?)\/messages\/?(.+?)?$/.exec(packet.topic);
|
||||
var channel = /^channels\/(.+?)\/messages\/?.*$/.exec(packet.topic);
|
||||
if (!channel) {
|
||||
logger.warn('unknown topic');
|
||||
subscribe(4, packet); // Bad username or password
|
||||
|
Loading…
x
Reference in New Issue
Block a user