Skip to content

Commit ca7c579

Browse files
committed
Ignore empty names
Signed-off-by: David Gageot <[email protected]>
1 parent 7a65327 commit ca7c579

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/docker-mcp/internal/gateway/transport.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ func (g *Gateway) startCentralStreamingServer(ctx context.Context, newMCPServer
100100
func parseServerNames(serverNames string) []string {
101101
var names []string
102102
for name := range strings.SplitSeq(serverNames, ",") {
103-
names = append(names, strings.TrimSpace(name))
103+
name := strings.TrimSpace(name)
104+
if name == "" {
105+
continue
106+
}
107+
108+
names = append(names, name)
104109
}
105110
return names
106111
}

0 commit comments

Comments
 (0)