Skip to content

Commit 5d18572

Browse files
committed
Trim newlines from command parsing
1 parent 4569ac0 commit 5d18572

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

discovery_server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ func (d *DiscoveryServer) Run(in io.Reader, out io.Writer) error {
120120
d.outputError("command_error", err.Error())
121121
return err
122122
}
123+
fullCmd = strings.TrimSpace(fullCmd)
123124
split := strings.Split(fullCmd, " ")
124-
cmd := strings.ToUpper(strings.TrimSpace(split[0]))
125+
cmd := strings.ToUpper(split[0])
125126

126127
if !d.initialized && cmd != "HELLO" {
127128
d.outputError("command_error", fmt.Sprintf("First command must be HELLO, but got '%s'", cmd))

0 commit comments

Comments
 (0)