about summary refs log tree commit diff stats
path: root/internal/server/mime.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/mime.go')
-rw-r--r--internal/server/mime.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/server/mime.go b/internal/server/mime.go
new file mode 100644
index 0000000..cb1b1cf
--- /dev/null
+++ b/internal/server/mime.go
@@ -0,0 +1,19 @@
+package server
+
+import (
+	"mime"
+
+	"go.alanpearce.eu/x/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)
+		}
+	}
+}