diff --git a/go.mod b/go.mod
index 409bb173..031d6473 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@ toolchain go1.24.2
require (
github.com/dustin/go-humanize v1.0.1
github.com/felixge/httpsnoop v1.0.4
- github.com/gabriel-vasile/mimetype v1.4.11
+ github.com/gabriel-vasile/mimetype v1.4.12
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/lib/pq v1.10.9
@@ -15,6 +15,7 @@ require (
github.com/oschwald/maxminddb-golang v1.13.1
github.com/prometheus/client_golang v1.23.2
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
+ golang.org/x/sys v0.38.0
)
require (
@@ -39,7 +40,6 @@ require (
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/net v0.47.0 // indirect
- golang.org/x/sys v0.38.0 // indirect
golang.org/x/text v0.31.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/go.sum b/go.sum
index 30b1f5da..685768ad 100644
--- a/go.sum
+++ b/go.sum
@@ -9,8 +9,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/gabriel-vasile/mimetype v1.4.11 h1:AQvxbp830wPhHTqc1u7nzoLT+ZFxGY7emj5DR5DYFik=
-github.com/gabriel-vasile/mimetype v1.4.11/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
+github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
+github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
diff --git a/vendor/github.com/gabriel-vasile/mimetype/.golangci.yml b/vendor/github.com/gabriel-vasile/mimetype/.golangci.yml
index f2058ccc..5b30cd61 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/.golangci.yml
+++ b/vendor/github.com/gabriel-vasile/mimetype/.golangci.yml
@@ -1,5 +1,41 @@
version: "2"
+
+run:
+ timeout: 5m
+
linters:
exclusions:
presets:
- std-error-handling
+ enable:
+ - gosec # Detects security problems.
+ # Keep all extras disabled for now to focus on the integer overflow problem.
+ # TODO: enable these and other good linters
+ - dogsled # Detects assignments with too many blank identifiers.
+ - errcheck
+ - errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted.
+ - exhaustive # Detects missing options in enum switch statements.
+ - gocyclo
+ - govet
+ - ineffassign
+ - makezero # Finds slice declarations with non-zero initial length.
+ - misspell # Detects commonly misspelled English words in comments.
+ - nakedret # Detects uses of naked returns.
+ - prealloc # Detects slice declarations that could potentially be pre-allocated.
+ - predeclared # Detects code that shadows one of Go's predeclared identifiers.
+ - reassign # Detects reassigning a top-level variable in another package.
+ - staticcheck
+ - thelper # Detects test helpers without t.Helper().
+ - tparallel # Detects inappropriate usage of t.Parallel().
+ - unconvert # Detects unnecessary type conversions.
+ - unused
+ - usestdlibvars # Detects the possibility to use variables/constants from the Go standard library.
+ - usetesting # Reports uses of functions with replacement inside the testing package.
+ settings:
+ govet:
+ disable:
+ - stdversion
+ gosec:
+ excludes:
+ - G404 # Weak random number generator used in tests.
+ - G304 # File inclusion
diff --git a/vendor/github.com/gabriel-vasile/mimetype/README.md b/vendor/github.com/gabriel-vasile/mimetype/README.md
index ea5c89a9..9fe71ac9 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/README.md
+++ b/vendor/github.com/gabriel-vasile/mimetype/README.md
@@ -70,13 +70,13 @@ If increasing the limit does not help, please
## Tests
In addition to unit tests,
[mimetype_tests](https://github.com/gabriel-vasile/mimetype_tests) compares the
-library with the [Unix file utility](https://en.wikipedia.org/wiki/File_(command))
+library with [libmagic](https://en.wikipedia.org/wiki/File_(command))
for around 50 000 sample files. Check the latest comparison results
[here](https://github.com/gabriel-vasile/mimetype_tests/actions).
## Benchmarks
-Benchmarks for each file format are performed when a PR is open. The results can
-be seen on the [workflows page](https://github.com/gabriel-vasile/mimetype/actions/workflows/benchmark.yml).
+Benchmarks are performed when a PR is open. The results can be seen on the
+[workflows page](https://github.com/gabriel-vasile/mimetype/actions/workflows/benchmark.yml).
Performance improvements are welcome but correctness is prioritized.
## Structure
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go
index d11c0a88..fc3c7720 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go
@@ -94,20 +94,6 @@ func eq(path1, path2 [][]byte) bool {
return true
}
-// LooksLikeObjectOrArray reports if first non white space character from raw
-// is either { or [. Parsing raw as JSON is a heavy operation. When receiving some
-// text input we can skip parsing if the input does not even look like JSON.
-func LooksLikeObjectOrArray(raw []byte) bool {
- for i := range raw {
- if isSpace(raw[i]) {
- continue
- }
- return raw[i] == '{' || raw[i] == '['
- }
-
- return false
-}
-
// Parse will take out a parser from the pool depending on queryType and tries
// to parse raw bytes as JSON.
func Parse(queryType string, raw []byte) (parsed, inspected, firstToken int, querySatisfied bool) {
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go
index 8a0c8499..0b4c62f1 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go
@@ -106,10 +106,10 @@ func CRX(raw []byte, limit uint32) bool {
if len(raw) < minHeaderLen || !bytes.HasPrefix(raw, []byte("Cr24")) {
return false
}
- pubkeyLen := binary.LittleEndian.Uint32(raw[8:12])
- sigLen := binary.LittleEndian.Uint32(raw[12:16])
+ pubkeyLen := int64(binary.LittleEndian.Uint32(raw[8:12]))
+ sigLen := int64(binary.LittleEndian.Uint32(raw[12:16]))
zipOffset := minHeaderLen + pubkeyLen + sigLen
- if uint32(len(raw)) < zipOffset {
+ if zipOffset < 0 || int64(len(raw)) < zipOffset {
return false
}
return Zip(raw[zipOffset:], limit)
@@ -209,3 +209,13 @@ func tarChksum(b []byte) (unsigned, signed int64) {
}
return unsigned, signed
}
+
+// Zlib matches zlib compressed files.
+func Zlib(raw []byte, _ uint32) bool {
+ // https://www.ietf.org/rfc/rfc6713.txt
+ // This check has one fault: ASCII code can satisfy it; for ex: []byte("x ")
+ zlib := len(raw) > 1 &&
+ raw[0] == 'x' && binary.BigEndian.Uint16(raw)%31 == 0
+ // Check that the file is not a regular text to avoid false positives.
+ return zlib && !Text(raw, 0)
+}
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/meteo.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/meteo.go
new file mode 100644
index 00000000..da77d0b0
--- /dev/null
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/meteo.go
@@ -0,0 +1,12 @@
+package magic
+
+import "bytes"
+
+// GRIB matches a GRIdded Binary meteorological file.
+// https://www.nco.ncep.noaa.gov/pmb/docs/on388/
+// https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/
+func GRIB(raw []byte, _ uint32) bool {
+ return len(raw) > 7 &&
+ bytes.HasPrefix(raw, []byte("GRIB")) &&
+ (raw[7] == 1 || raw[7] == 2)
+}
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go
index bd4a0c36..e689e92a 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go
@@ -192,7 +192,8 @@ func matchOleClsid(in []byte, clsid []byte) bool {
// Expected offset of CLSID for root storage object.
clsidOffset := sectorLength*(1+firstSecID) + 80
- if len(in) <= clsidOffset+16 {
+ // #731 offset is outside in or wrapped around due to integer overflow.
+ if len(in) <= clsidOffset+16 || clsidOffset < 0 {
return false
}
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go
index fb84e854..82f6c670 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go
@@ -283,7 +283,7 @@ func Shell(raw []byte, _ uint32) bool {
// Text matches a plain text file.
//
// TODO: This function does not parse BOM-less UTF16 and UTF32 files. Not really
-// sure it should. Linux file utility also requires a BOM for UTF16 and UTF32.
+// sure it should. libmagic also requires a BOM for UTF16 and UTF32.
func Text(raw []byte, _ uint32) bool {
// First look for BOM.
if cset := charset.FromBOM(raw); cset != "" {
@@ -352,13 +352,20 @@ func GLTF(raw []byte, limit uint32) bool {
return jsonHelper(raw, limit, json.QueryGLTF, json.TokObject)
}
-func jsonHelper(raw []byte, limit uint32, q string, wantTok int) bool {
- if !json.LooksLikeObjectOrArray(raw) {
+func jsonHelper(raw scan.Bytes, limit uint32, q string, wantToks ...int) bool {
+ firstNonWS := raw.FirstNonWS()
+
+ hasTargetTok := false
+ for _, t := range wantToks {
+ hasTargetTok = hasTargetTok || (t&json.TokArray > 0 && firstNonWS == '[')
+ hasTargetTok = hasTargetTok || (t&json.TokObject > 0 && firstNonWS == '{')
+ }
+ if !hasTargetTok {
return false
}
lraw := len(raw)
- parsed, inspected, firstToken, querySatisfied := json.Parse(q, raw)
- if !querySatisfied || firstToken&wantTok == 0 {
+ parsed, inspected, _, querySatisfied := json.Parse(q, raw)
+ if !querySatisfied {
return false
}
@@ -369,7 +376,7 @@ func jsonHelper(raw []byte, limit uint32, q string, wantTok int) bool {
// If a section of the file was provided, check if all of it was inspected.
// In other words, check that if there was a problem parsing, that problem
- // occured at the last byte in the input.
+ // occurred at the last byte in the input.
return inspected == lraw && lraw > 0
}
@@ -536,3 +543,57 @@ func Vtt(raw []byte, limit uint32) bool {
return bytes.Equal(raw, []byte{0xEF, 0xBB, 0xBF, 0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) || // UTF-8 BOM and "WEBVTT"
bytes.Equal(raw, []byte{0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) // "WEBVTT"
}
+
+type rfc822Hint struct {
+ h []byte
+ matchFlags scan.Flags
+}
+
+// The hints come from libmagic, but the implementation is bit different. libmagic
+// only checks if the file starts with the hint, while we additionally look for
+// a secondary hint in the first few lines of input.
+func RFC822(raw []byte, limit uint32) bool {
+ b := scan.Bytes(raw)
+
+ // Keep hints here to avoid instantiating them several times in lineHasRFC822Hint.
+ // The alternative is to make them a package level var, but then they'd go
+ // on the heap.
+ // Some of the hints are IgnoreCase, some not. I selected based on what libmagic
+ // does and based on personal observations from sample files.
+ hints := []rfc822Hint{
+ {[]byte("From: "), 0},
+ {[]byte("To: "), 0},
+ {[]byte("CC: "), scan.IgnoreCase},
+ {[]byte("Date: "), 0},
+ {[]byte("Subject: "), 0},
+ {[]byte("Received: "), 0},
+ {[]byte("Relay-Version: "), 0},
+ {[]byte("#! rnews"), 0},
+ {[]byte("N#! rnews"), 0},
+ {[]byte("Forward to"), 0},
+ {[]byte("Pipe to"), 0},
+ {[]byte("DELIVERED-TO: "), scan.IgnoreCase},
+ {[]byte("RETURN-PATH: "), scan.IgnoreCase},
+ {[]byte("Content-Type: "), 0},
+ {[]byte("Content-Transfer-Encoding: "), 0},
+ }
+ if !lineHasRFC822Hint(b.Line(), hints) {
+ return false
+ }
+ for i := 0; i < 20; i++ {
+ if lineHasRFC822Hint(b.Line(), hints) {
+ return true
+ }
+ }
+
+ return false
+}
+
+func lineHasRFC822Hint(b scan.Bytes, hints []rfc822Hint) bool {
+ for _, h := range hints {
+ if b.Match(h.h, h.matchFlags) > -1 {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go
index 830c5ed2..23e30da2 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go
@@ -69,9 +69,9 @@ func isFileTypeNamePresent(in []byte, flType string) bool {
// vintWidth parses the variable-integer width in matroska containers
func vintWidth(v int) int {
- mask, max, num := 128, 8, 1
- for num < max && v&mask == 0 {
- mask = mask >> 1
+ mask, nTimes, num := 128, 8, 1
+ for num < nTimes && v&mask == 0 {
+ mask >>= 1
num++
}
return num
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go
index 31f42482..f3bfa2ac 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go
@@ -85,10 +85,14 @@ func Zip(raw []byte, limit uint32) bool {
// (instead of relying on offsets told by the file.)
func Jar(raw []byte, limit uint32) bool {
return executableJar(raw) ||
+ // First entry must be an empty META-INF directory or the manifest.
+ // There is no specification saying that, but the jar reader and writer
+ // implementations from Java do it that way.
+ // https://github.com/openjdk/jdk/blob/88c4678eed818cbe9380f35352e90883fed27d33/src/java.base/share/classes/java/util/jar/JarInputStream.java#L170-L173
zipHas(raw, zipEntries{{
- name: []byte("META-INF/MANIFEST.MF"),
- }, {
name: []byte("META-INF/"),
+ }, {
+ name: []byte("META-INF/MANIFEST.MF"),
}}, 1)
}
@@ -127,11 +131,14 @@ type zipEntries []struct {
func (z zipEntries) match(file []byte) bool {
for i := range z {
- if z[i].dir && bytes.HasPrefix(file, z[i].name) {
- return true
- }
- if bytes.Equal(file, z[i].name) {
- return true
+ if z[i].dir {
+ if bytes.HasPrefix(file, z[i].name) {
+ return true
+ }
+ } else {
+ if bytes.Equal(file, z[i].name) {
+ return true
+ }
}
}
return false
diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go
index b19a9492..552b4ead 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go
@@ -35,6 +35,19 @@ func (b *Bytes) TrimRWS() {
}
}
+// FirstNonWS returns the first non-whitespace character from b,
+// or 0x00 if no such character is found.
+func (b Bytes) FirstNonWS() byte {
+ for i := range b {
+ if ByteIsWS(b[i]) {
+ continue
+ }
+ return b[i]
+ }
+
+ return 0x00
+}
+
// Peek one byte from b or 0x00 if b is empty.
func (b *Bytes) Peek() byte {
if len(*b) > 0 {
@@ -63,8 +76,8 @@ func (b *Bytes) PopN(n int) []byte {
return nil
}
-// PopUntil will advance b until, but not including, the first occurence of stopAt
-// character. If no occurence is found, then it will advance until the end of b.
+// PopUntil will advance b until, but not including, the first occurrence of stopAt
+// character. If no occurrence is found, then it will advance until the end of b.
// The returned Bytes is a slice of all the bytes that we're advanced over.
func (b *Bytes) PopUntil(stopAt ...byte) Bytes {
if len(*b) == 0 {
@@ -77,7 +90,7 @@ func (b *Bytes) PopUntil(stopAt ...byte) Bytes {
prefix := (*b)[:i]
*b = (*b)[i:]
- return Bytes(prefix)
+ return prefix
}
// ReadSlice is the same as PopUntil, but the returned value includes stopAt as well.
@@ -94,7 +107,7 @@ func (b *Bytes) ReadSlice(stopAt byte) Bytes {
prefix := (*b)[:i]
*b = (*b)[i:]
- return Bytes(prefix)
+ return prefix
}
// Line returns the first line from b and advances b with the length of the
@@ -117,7 +130,7 @@ func (b *Bytes) Line() Bytes {
// If b length is less than readLimit, it means we received an incomplete file
// and proceed with dropping the last line.
func (b *Bytes) DropLastLine(readLimit uint32) {
- if readLimit == 0 || uint32(len(*b)) < readLimit {
+ if readLimit == 0 || uint64(len(*b)) < uint64(readLimit) {
return
}
@@ -151,7 +164,7 @@ const (
FullWord
)
-// Search for occurences of pattern p inside b at any index.
+// Search for occurrences of pattern p inside b at any index.
// It returns the index where p was found in b and how many bytes were needed
// for matching the pattern.
func (b Bytes) Search(p []byte, flags Flags) (i int, l int) {
diff --git a/vendor/github.com/gabriel-vasile/mimetype/mime.go b/vendor/github.com/gabriel-vasile/mimetype/mime.go
index ec2bc5bf..3dadf720 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/mime.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/mime.go
@@ -2,6 +2,7 @@ package mimetype
import (
"mime"
+ "slices"
"strings"
"github.com/gabriel-vasile/mimetype/internal/charset"
@@ -58,10 +59,8 @@ func (m *MIME) Is(expectedMIME string) bool {
return true
}
- for _, alias := range m.aliases {
- if alias == expectedMIME {
- return true
- }
+ if slices.Contains(m.aliases, expectedMIME) {
+ return true
}
return false
@@ -180,10 +179,8 @@ func (m *MIME) lookup(mime string) *MIME {
if mime == m.mime {
return m
}
- for _, n := range m.aliases {
- if n == mime {
- return m
- }
+ if slices.Contains(m.aliases, mime) {
+ return m
}
for _, c := range m.children {
diff --git a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md
index 241a81f4..45de7b9e 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md
+++ b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md
@@ -1,4 +1,4 @@
-## 192 Supported MIME types
+## 195 Supported MIME types
This file is automatically generated when running tests. Do not edit manually.
Extension | MIME type
Aliases | Hierarchy
@@ -152,6 +152,8 @@ Extension | MIME type
Aliases | Hierarchy
**.chm** | **application/vnd.ms-htmlhelp** | chm>root
**.wpd** | **application/vnd.wordperfect** | wpd>root
**.dxf** | **image/vnd.dxf** | dxf>root
+**.grb** | **application/grib** | grb>root
+**n/a** | **application/zlib** | zlib>root
**.txt** | **text/plain** | txt>root
**.svg** | **image/svg+xml** | svg>txt>root
**.html** | **text/html** | html>txt>root
@@ -195,3 +197,4 @@ Extension | MIME type
Aliases | Hierarchy
**.pgm** | **image/x-portable-graymap** | pgm>txt>root
**.ppm** | **image/x-portable-pixmap** | ppm>txt>root
**.pam** | **image/x-portable-arbitrarymap** | pam>txt>root
+**.eml** | **message/rfc822** | eml>txt>root
diff --git a/vendor/github.com/gabriel-vasile/mimetype/tree.go b/vendor/github.com/gabriel-vasile/mimetype/tree.go
index 21b70d5c..29ef820b 100644
--- a/vendor/github.com/gabriel-vasile/mimetype/tree.go
+++ b/vendor/github.com/gabriel-vasile/mimetype/tree.go
@@ -24,7 +24,7 @@ var root = newMIME("application/octet-stream", "",
woff2, otf, ttc, eot, wasm, shx, dbf, dcm, rar, djvu, mobi, lit, bpg, cbor,
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, parquet,
- oneNote, chm, wpd, dxf,
+ oneNote, chm, wpd, dxf, grib, zlib,
// Keep text last because it is the slowest check.
text,
)
@@ -82,7 +82,7 @@ var (
alias("application/x-ogg")
oggAudio = newMIME("audio/ogg", ".oga", magic.OggAudio)
oggVideo = newMIME("video/ogg", ".ogv", magic.OggVideo)
- text = newMIME("text/plain", ".txt", magic.Text, svg, html, xml, php, js, lua, perl, python, ruby, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt, shell, netpbm, netpgm, netppm, netpam)
+ text = newMIME("text/plain", ".txt", magic.Text, svg, html, xml, php, js, lua, perl, python, ruby, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt, shell, netpbm, netpgm, netppm, netpam, rfc822)
xml = newMIME("text/xml", ".xml", magic.XML, rss, atom, x3d, kml, xliff, collada, gml, gpx, tcx, amf, threemf, xfdf, owl2, xhtml).
alias("application/xml")
xhtml = newMIME("application/xhtml+xml", ".html", magic.XHTML)
@@ -287,4 +287,7 @@ var (
chm = newMIME("application/vnd.ms-htmlhelp", ".chm", magic.CHM)
wpd = newMIME("application/vnd.wordperfect", ".wpd", magic.WPD)
dxf = newMIME("image/vnd.dxf", ".dxf", magic.DXF)
+ rfc822 = newMIME("message/rfc822", ".eml", magic.RFC822)
+ grib = newMIME("application/grib", ".grb", magic.GRIB)
+ zlib = newMIME("application/zlib", "", magic.Zlib)
)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 1ed65174..d774fbca 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -10,7 +10,7 @@ github.com/dustin/go-humanize
# github.com/felixge/httpsnoop v1.0.4
## explicit; go 1.13
github.com/felixge/httpsnoop
-# github.com/gabriel-vasile/mimetype v1.4.11
+# github.com/gabriel-vasile/mimetype v1.4.12
## explicit; go 1.21
github.com/gabriel-vasile/mimetype
github.com/gabriel-vasile/mimetype/internal/charset