mirror of https://github.com/tidwall/tile38.git
Allow slashes for MQTT topic, fixes #410
This commit is contained in:
parent
30f903bd51
commit
99508c9af7
|
@ -404,10 +404,15 @@ func parseEndpoint(s string) (Endpoint, error) {
|
||||||
// Parsing MQTT queue name
|
// Parsing MQTT queue name
|
||||||
if len(sp) > 1 {
|
if len(sp) > 1 {
|
||||||
var err error
|
var err error
|
||||||
endpoint.MQTT.QueueName, err = url.QueryUnescape(sp[1])
|
var parts []string
|
||||||
|
for _, part := range sp[1:] {
|
||||||
|
part, err = url.QueryUnescape(part)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return endpoint, errors.New("invalid MQTT topic name")
|
return endpoint, errors.New("invalid MQTT topic name")
|
||||||
}
|
}
|
||||||
|
parts = append(parts, part)
|
||||||
|
}
|
||||||
|
endpoint.MQTT.QueueName = strings.Join(parts, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parsing additional params
|
// Parsing additional params
|
||||||
|
|
Loading…
Reference in New Issue