forked from aahancoc/tree_magic
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
The shared-mime-info-spec does not mention it but I assume this check is incorrect
tree_magic/src/fdo_magic/check.rs
Lines 8 to 10 in adc1b40
| if (file.len()) < bound_max { | |
| return false; | |
| } |
As an example it prevents mime-type detection of this short html file.
<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>
</head>
<body></body>
</html>The magic file contains the following rule for text/html
>0=\x00\x0E<!DOCTYPE HTML+257
setting a range-length of 257 bytes preventing detection of the 90 byte html file.
My interpretation of the spec is that the first range-length bytes should be searched for the value, but not that the file needs to be at least range-length bytes long.
Metadata
Metadata
Assignees
Labels
No labels