Only trim CR and NF from the submitted expression

So the trailing space in the following case is respected.

  curl -XPOST localhost:6266 -d "change-prompt:$(date)> "
This commit is contained in:
Junegunn Choi 2022-12-20 23:31:53 +09:00
parent a7a771b92b
commit cf69b836ac

View File

@ -97,7 +97,7 @@ func handleHttpRequest(conn net.Conn, channel chan []*action) string {
} }
errorMessage := "" errorMessage := ""
actions := parseSingleActionList(strings.TrimSpace(string(body)), func(message string) { actions := parseSingleActionList(strings.Trim(string(body), "\r\n"), func(message string) {
errorMessage = message errorMessage = message
}) })
if len(errorMessage) > 0 { if len(errorMessage) > 0 {