mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-22 20:00:22 +00:00
+2
-2
@@ -125,7 +125,7 @@ func (h *handler) Publish(c *session.Client, topic *string, payload *[]byte) {
|
||||
}
|
||||
h.logger.Info("Publish - client ID " + c.ID + " to the topic: " + *topic)
|
||||
// Topics are in the format:
|
||||
// channels/<channel_id>/messages/<subtopic>/.../ct/<content_type>
|
||||
// ch/<channel_id>/msg/<subtopic>/.../ct/<content_type>
|
||||
|
||||
channelParts := channelRegExp.FindStringSubmatch(*topic)
|
||||
if len(channelParts) < 1 {
|
||||
@@ -190,7 +190,7 @@ func (h *handler) Disconnect(c *session.Client) {
|
||||
|
||||
func (h *handler) authAccess(username string, topic string) error {
|
||||
// Topics are in the format:
|
||||
// channels/<channel_id>/messages/<subtopic>/.../ct/<content_type>
|
||||
// ch/<channel_id>/msg/<subtopic>/.../ct/<content_type>
|
||||
if !channelRegExp.Match([]byte(topic)) {
|
||||
h.logger.Info("Malformed topic: " + topic)
|
||||
return errMalformedTopic
|
||||
|
||||
Reference in New Issue
Block a user