media: Add missing BMP and GIF to the default MediaTypes list

This commit is contained in:
Bjørn Erik Pedersen
2021-12-21 09:54:14 +01:00
parent cdc73526a8
commit ce04011096
4 changed files with 14 additions and 1 deletions

View File

@@ -274,6 +274,8 @@ var DefaultTypes = Types{
YAMLType,
TOMLType,
PNGType,
GIFType,
BMPType,
JPEGType,
WEBPType,
AVIType,
@@ -289,6 +291,15 @@ var DefaultTypes = Types{
func init() {
sort.Sort(DefaultTypes)
// Sanity check.
seen := make(map[Type]bool)
for _, t := range DefaultTypes {
if seen[t] {
panic(fmt.Sprintf("MediaType %s duplicated in list", t))
}
seen[t] = true
}
}
// Types is a slice of media types.