about summary refs log tree commit diff stats
path: root/internal/server/mime.go
blob: 340e4c5a6770292f4cfe28cfd8994396187d2f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package server

import (
	"mime"

	"go.alanpearce.eu/website/internal/log"
)

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

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