mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-07-03 18:22:49 +00:00
Make mimetype.FromExtension case-insensitive
This commit is contained in:
parent
4cb963d47d
commit
b41a2f10d4
@ -17,7 +17,7 @@ func ToExtension(mime string) string {
|
|||||||
|
|
||||||
// FromExtension returns mime-type for given extension. The extension must start with a dot.
|
// FromExtension returns mime-type for given extension. The extension must start with a dot.
|
||||||
func FromExtension(ext string) string {
|
func FromExtension(ext string) string {
|
||||||
if mime, ok := mapExt2Mime[ext]; ok {
|
if mime, ok := mapExt2Mime[strings.ToLower(ext)]; ok {
|
||||||
return mime
|
return mime
|
||||||
}
|
}
|
||||||
return "application/octet-stream"
|
return "application/octet-stream"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user