mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-02-23 12:20:12 +08:00
Fix isPrintable helper
This commit is contained in:
parent
d58d549d4c
commit
403062b556
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user