diff options
author | Alan Pearce | 2024-05-22 16:48:57 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-22 16:48:57 +0200 |
commit | aef028263229d8acda28b8e657413f7e9c187833 (patch) | |
tree | e465629cbf9b5fc5e148f0f8bc1c8be97f1e03c7 /internal/server/mime.go | |
parent | 1d9d4fc9812f9eb15e78398340053afb32a3c55a (diff) | |
download | website-aef028263229d8acda28b8e657413f7e9c187833.tar.lz website-aef028263229d8acda28b8e657413f7e9c187833.tar.zst website-aef028263229d8acda28b8e657413f7e9c187833.zip |
refactor: split server and mux
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() +} |