MCPcopy
hub / github.com/perkeep/perkeep / MIMETypeByExtension

Function MIMETypeByExtension

internal/magic/magic.go:276–279  ·  view source on GitHub ↗

MIMETypeByExtension calls mime.TypeByExtension, and removes optional parameters, to keep only the type and subtype.

(ext string)

Source from the content-addressed store, hash-verified

274// MIMETypeByExtension calls mime.TypeByExtension, and removes optional parameters,
275// to keep only the type and subtype.
276func MIMETypeByExtension(ext string) string {
277 mimeParts := strings.SplitN(mime.TypeByExtension(ext), ";", 2)
278 return strings.TrimSpace(mimeParts[0])
279}
280
281var pict = []byte("pict")
282

Callers 2

populateFileMethod · 0.92
serveFileDownloadMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected