From 403062b556ef2ec2311eb379a181b682f764a5af Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Wed, 2 Jun 2021 06:25:37 -0700 Subject: [PATCH] Fix isPrintable helper --- conversion_helpers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conversion_helpers.go b/conversion_helpers.go index 9d073e4..2cbdd40 100644 --- a/conversion_helpers.go +++ b/conversion_helpers.go @@ -171,12 +171,16 @@ func isPrintable(data []byte) bool { if !utf8.Valid(data) { return false } + isAllSpace := true for _, r := range string(data) { if !unicode.IsPrint(r) { return false } + if !unicode.IsSpace(r) { + isAllSpace = false + } } - return true + return !isAllSpace } func toPrintablePayload(payload []byte) string {