|
@@ -10,6 +10,7 @@ import (
|
|
|
"sparrow/pkg/rpcs"
|
|
|
"sparrow/pkg/server"
|
|
|
"sparrow/pkg/token"
|
|
|
+ "strings"
|
|
|
|
|
|
"github.com/opentracing/opentracing-go/ext"
|
|
|
|
|
@@ -113,11 +114,11 @@ func AuthDevice(args DeviceAuthArgs, r render.Render) {
|
|
|
var hosts []string
|
|
|
switch args.Protocol {
|
|
|
case "http":
|
|
|
- hosts, err = server.GetServerHosts(args.Protocol+"access", "httphost")
|
|
|
+ hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "httphost")
|
|
|
case "mqtt":
|
|
|
- hosts, err = server.GetServerHosts(args.Protocol+"access", "tcphost")
|
|
|
+ hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "tcphost")
|
|
|
case "coap":
|
|
|
- hosts, err = server.GetServerHosts(args.Protocol+"access", "udphost")
|
|
|
+ hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "udphost")
|
|
|
default:
|
|
|
err = errors.New("unsuported protocol: " + args.Protocol)
|
|
|
}
|