Bugfix: fast path for empty magic

This commit is contained in:
2025-10-09 15:37:06 +02:00
parent 99c461bb14
commit 170a038612

View File

@@ -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)
}