From f1528ce48bbda5d864fa2d637832580752e5b74d Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Fri, 17 Dec 2021 18:54:51 +0200 Subject: [PATCH] [mime] Compile list of mime-types. --- sources/lib/common/mime.go | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/sources/lib/common/mime.go b/sources/lib/common/mime.go index cbdc4d4..26bf4ba 100644 --- a/sources/lib/common/mime.go +++ b/sources/lib/common/mime.go @@ -63,6 +63,8 @@ const MimeTypeZip = "application/zip" const MimeTypeRaw = "application/octet-stream" + + var MimeTypesByExtension = map[string]string { // NOTE: Based on: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types @@ -129,3 +131,65 @@ var MimeTypesByExtension = map[string]string { } + + + +var MimeTypes = []string { + + MimeTypeText, + MimeTypeCsv, + + MimeTypeHtml, + MimeTypeCss, + MimeTypeJs, + MimeTypeJson, + + MimeTypeXml, + MimeTypeXslt, + MimeTypeXhtml, + + MimeTypeSvg, + MimeTypePng, + MimeTypeJpeg, + MimeTypeWebp, + MimeTypeGif, + MimeTypeIco, + MimeTypeBmp, + MimeTypeTiff, + MimeTypeApng, + + MimeTypeAvif, + MimeTypeAvifSequence, + MimeTypeHeic, + MimeTypeHeicSequence, + MimeTypeHeif, + MimeTypeHeifSequence, + + MimeTypeOtf, + MimeTypeTtf, + MimeTypeWoff, + MimeTypeWoff2, + + MimeTypeWav, + MimeTypeMidi, + MimeTypeAac, + MimeTypeOpus, + MimeTypeAudioMpeg, + MimeTypeAudioWebm, + MimeTypeAudioOgg, + + MimeTypeAvi, + MimeTypeMp4, + MimeTypeVideoMpeg, + MimeTypeVideoWebm, + MimeTypeVideoOgg, + + MimeTypePdf, + MimeTypePs, + MimeTypeIcs, + + MimeTypeZip, + MimeTypeRaw, + + } +