1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-04 18:19:54 +00:00

Make mimetype.FromExtension case-insensitive

This commit is contained in:
Timur Ismagilov 2022-02-20 12:28:33 +03:00
parent 4cb963d47d
commit b41a2f10d4

View File

@ -17,7 +17,7 @@ func ToExtension(mime string) string {
// FromExtension returns mime-type for given extension. The extension must start with a dot.
func FromExtension(ext string) string {
if mime, ok := mapExt2Mime[ext]; ok {
if mime, ok := mapExt2Mime[strings.ToLower(ext)]; ok {
return mime
}
return "application/octet-stream"