Commit d9f1fac3 authored by jackgr's avatar jackgr

Fix client property parsing

parent c69ed291
...@@ -40,15 +40,15 @@ func parseProperties(kvstr string) (map[string]interface{}, error) { ...@@ -40,15 +40,15 @@ func parseProperties(kvstr string) (map[string]interface{}, error) {
// Allow for "k=v, k=v" // Allow for "k=v, k=v"
p = strings.TrimSpace(p) p = strings.TrimSpace(p)
pair := strings.Split(p, "=") pair := strings.Split(p, "=")
if len(pair) == 1 { if len(pair) < 2 {
return properties, errInvalidProperty return properties, errInvalidProperty
} }
// If the value looks int-like, convert it. // If the value looks int-like, convert it.
if i, err := strconv.Atoi(pair[1]); err == nil { if i, err := strconv.Atoi(pair[1]); err == nil {
properties[pair[0]] = pair[1]
} else {
properties[pair[0]] = i properties[pair[0]] = i
} else {
properties[pair[0]] = pair[1]
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment