From b45b296f6098901169472920051bb0e1222e0c54 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Tue, 21 Dec 2021 20:28:22 +0200 Subject: [PATCH] [common] Add a few canonical MIME types (as returned by `http.DetectContentType`). --- sources/lib/common/headers.go | 1 + sources/lib/common/mime.go | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sources/lib/common/headers.go b/sources/lib/common/headers.go index b2ef0d3..49c233f 100644 --- a/sources/lib/common/headers.go +++ b/sources/lib/common/headers.go @@ -244,6 +244,7 @@ func init () { CanonicalHeaderValues = append (CanonicalHeaderValues, MimeTypes ...) + CanonicalHeaderValues = append (CanonicalHeaderValues, MimeTypesExtras ...) CanonicalHeaderValuesMap = make (map[string]string, len (CanonicalHeaderValues)) CanonicalHeaderValuesArraysMap = make (map[string][]string, len (CanonicalHeaderValues)) diff --git a/sources/lib/common/mime.go b/sources/lib/common/mime.go index caf4b20..21b5f59 100644 --- a/sources/lib/common/mime.go +++ b/sources/lib/common/mime.go @@ -199,3 +199,24 @@ var MimeTypesAliases = map[string]string { "text/xml; charset=utf-8" : MimeTypeXml, } + +var MimeTypesExtras = []string { + + "text/plain; charset=utf-16be", + "text/plain; charset=utf-16le", + + "audio/aiff", + "audio/basic", + "audio/wave", + + "video/avi", + + "font/collection", + + "application/ogg", + "application/vnd.ms-fontobject", + "application/wasm", + "application/x-gzip", + "application/x-rar-compressed", + } +