Browse Source

ensure device name is in lower case

Mark deVilliers 2 years ago
parent
commit
d736c03fe6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      node/api/devices.go

+ 3 - 1
node/api/devices.go

@@ -4,6 +4,7 @@ import (
4 4
 	"context"
5 5
 	"net/http"
6 6
 	"sort"
7
+	"strings"
7 8
 
8 9
 	"gogs.dyne.org/DECODE/decode-prototype-da/node/sensors"
9 10
 	"gogs.dyne.org/DECODE/decode-prototype-da/utils"
@@ -120,7 +121,8 @@ func (e deviceResource) newDevice(request *restful.Request, response *restful.Re
120 121
 		return
121 122
 	}
122 123
 
123
-	name := randomdata.SillyName()
124
+	name := strings.ToLower(randomdata.SillyName())
125
+
124 126
 	// add the metadata to the catalog
125 127
 	e.metaStore.Add(Metadata{Subject: subject.String(), Description: description, Name: name})
126 128