diff --git a/protocol/match.go b/protocol/match.go index 812a4c1..9d64e4e 100644 --- a/protocol/match.go +++ b/protocol/match.go @@ -9,6 +9,9 @@ package protocol // // Returns true if all magic bytes are matched, even if input has extra bytes. func Match(magic string, input []byte) bool { + if len(magic) == 0 { + return true + } return match(magic, input, 0, 0) }