feat(scanner): support non lowercase extensions like .Mp3
https://github.com/sentriz/gonic/issues/308#issuecomment-1505650896
This commit is contained in:
@@ -4,6 +4,7 @@ package mime
|
||||
import (
|
||||
"log"
|
||||
stdmime "mime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var supportedAudioTypes = map[string]string{
|
||||
@@ -31,7 +32,7 @@ var ParseMediaType = stdmime.ParseMediaType
|
||||
var FormatMediaType = stdmime.FormatMediaType
|
||||
|
||||
func TypeByAudioExtension(ext string) string {
|
||||
if _, ok := supportedAudioTypes[ext]; !ok {
|
||||
if _, ok := supportedAudioTypes[strings.ToLower(ext)]; !ok {
|
||||
return ""
|
||||
}
|
||||
return stdmime.TypeByExtension(ext)
|
||||
|
||||
Reference in New Issue
Block a user