all repos — website @ b4095d108a2646bcf9e7fff64788b10d9bce8da3

My website

internal/server/mime.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package server

import (
	"mime"
	"website/internal/log"
)

var newMIMEs = map[string]string{
	".xsl": "text/xsl",
}

func fixupMIMETypes() {
	for ext, newType := range newMIMEs {
		if err := mime.AddExtensionType(ext, newType); err != nil {
			log.Error("could not update mime type", "ext", ext, "mime", newType)
		}
	}
}

func init() {
	fixupMIMETypes()
}