diff options
Diffstat (limited to 'internal/server/mime.go')
-rw-r--r-- | internal/server/mime.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/server/mime.go b/internal/server/mime.go new file mode 100644 index 0000000..696a0ad --- /dev/null +++ b/internal/server/mime.go @@ -0,0 +1,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() +} |