From 083e2b588e0e62d60baf536d844be58e502e6277 Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Sun, 11 Aug 2019 19:11:33 -0400 Subject: [PATCH] https://github.com/valeriansaliou/node-sonic-channel/blob/f88985149c4176490092e53f8b4f6f188db08900/lib/channel/generic.js#L59 --- sonic/ingester.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sonic/ingester.go b/sonic/ingester.go index acf24f9..7b01061 100644 --- a/sonic/ingester.go +++ b/sonic/ingester.go @@ -98,6 +98,16 @@ func NewIngester(host string, port int, password string) (Ingestable, error) { } func (i ingesterChannel) Push(collection, bucket, object, text string) (err error) { + // + patterns := []struct { + Pattern string + Replacement string + }{{"\\", "\\\\"}, + {"\n", "\\n"}, + {"\"", "\\\""}} + for _, v := range patterns { + text = strings.Replace(text, v.Pattern, v.Replacement, -1) + } chunks := splitText(text, i.cmdMaxBytes/2) // split chunks with partial success will yield single error