Fix isPrintable helper

This commit is contained in:
Ken Hibino 2021-06-02 06:25:37 -07:00
parent d58d549d4c
commit 403062b556

View File

@ -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 {