summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-12-20 23:31:53 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-12-21 01:35:08 +0900
commitcf69b836acc3b81d73827fceb64cdd52dbe1b2f4 (patch)
treed8beeae05ef15fc665d8343419cac1c5c8c1a01c
parenta7a771b92b9e802f71f807b87526f43707020ef8 (diff)
downloadfzf-cf69b836acc3b81d73827fceb64cdd52dbe1b2f4.tar.gz
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)> "
-rw-r--r--src/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.go b/src/server.go
index f196edee..eaa314c9 100644
--- a/src/server.go
+++ b/src/server.go
@@ -97,7 +97,7 @@ func handleHttpRequest(conn net.Conn, channel chan []*action) string {
}
errorMessage := ""
- actions := parseSingleActionList(strings.TrimSpace(string(body)), func(message string) {
+ actions := parseSingleActionList(strings.Trim(string(body), "\r\n"), func(message string) {
errorMessage = message
})
if len(errorMessage) > 0 {