diff --git a/internal/magic/binary.go b/internal/magic/binary.go index f1e94498..96040e6c 100644 --- a/internal/magic/binary.go +++ b/internal/magic/binary.go @@ -21,6 +21,8 @@ var ( SWF = prefix([]byte("CWS"), []byte("FWS"), []byte("ZWS")) // Torrent has bencoded text in the beginning. Torrent = prefix([]byte("d8:announce")) + // PAR1 matches a parquet file. + Par1 = prefix([]byte{0x50, 0x41, 0x52, 0x31}) ) // Java bytecode and Mach-O binaries share the same magic number. diff --git a/supported_mimes.md b/supported_mimes.md index a0799605..e6a65f6c 100644 --- a/supported_mimes.md +++ b/supported_mimes.md @@ -1,4 +1,4 @@ -## 175 Supported MIME types +## 176 Supported MIME types This file is automatically generated when running tests. Do not edit manually. Extension | MIME type | Aliases @@ -143,6 +143,7 @@ Extension | MIME type | Aliases **.glb** | model/gltf-binary | - **.cab** | application/x-installshield | - **.jxr** | image/jxr | image/vnd.ms-photo +**.parquet** | application/vnd.apache.parquet | application/x-parquet **.txt** | text/plain | - **.html** | text/html | - **.svg** | image/svg+xml | - diff --git a/testdata/parquet.parquet b/testdata/parquet.parquet new file mode 100644 index 00000000..7681f590 Binary files /dev/null and b/testdata/parquet.parquet differ diff --git a/tree.go b/tree.go index 6bf13619..d5a86670 100644 --- a/tree.go +++ b/tree.go @@ -23,7 +23,7 @@ var root = newMIME("application/octet-stream", "", avi, flv, mkv, asf, aac, voc, m3u, rmvb, gzip, class, swf, crx, ttf, woff, woff2, otf, ttc, eot, wasm, shx, dbf, dcm, rar, djvu, mobi, lit, bpg, sqlite3, dwg, nes, lnk, macho, qcp, icns, hdr, mrc, mdb, accdb, zstd, cab, - rpm, xz, lzip, torrent, cpio, tzif, xcf, pat, gbr, glb, cabIS, jxr, + rpm, xz, lzip, torrent, cpio, tzif, xcf, pat, gbr, glb, cabIS, jxr, parquet, // Keep text last because it is the slowest check. text, ) @@ -258,4 +258,6 @@ var ( xfdf = newMIME("application/vnd.adobe.xfdf", ".xfdf", magic.Xfdf) glb = newMIME("model/gltf-binary", ".glb", magic.Glb) jxr = newMIME("image/jxr", ".jxr", magic.Jxr).alias("image/vnd.ms-photo") + parquet = newMIME("application/vnd.apache.parquet", ".parquet", magic.Par1). + alias("application/x-parquet") )