Commit 91b5f0a

Eric Bower  ·  2026-02-24 20:46:40 -0500 EST
parent 1acc4d5
fix(pssh): strip quotes after splitting on them
2 files changed,  +2, -2
+1, -1
......@@ -537,7 +537,7 @@ func NewSSHServer(ctx context.Context, logger *slog.Logger, config *SSHServerCon
537537 splitter.SingleQuotes,
538538 )
539539 command = payload.Value
540- cmdSlice, _ := commaSplitter.Split(command)
540+ cmdSlice, _ := commaSplitter.Split(command, splitter.StripQuotes)
541541 sesh.SetValue("command", cmdSlice)
542542 }
543543
+1, -1
......@@ -329,7 +329,7 @@ func TestSSHServerCommandParsing(t *testing.T) {
329329
330330 time.Sleep(100 * time.Millisecond)
331331
332- expectedCommand := []string{"accept", "--comment", "'here we go'", "101"}
332+ expectedCommand := []string{"accept", "--comment", "here we go", "101"}
333333 if !slices.Equal(expectedCommand, capturedCommand) {
334334 t.Error("command not exected", capturedCommand, len(capturedCommand), expectedCommand, len(expectedCommand))
335335 }