Skip to content

Commit

Permalink
feat(scanner): support non lowercase extensions like .Mp3
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Apr 12, 2023
1 parent b8fceae commit d83fe56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mime/mime.go
Expand Up @@ -4,6 +4,7 @@ package mime
import (
"log"
stdmime "mime"
"strings"
)

var supportedAudioTypes = map[string]string{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d83fe56

Please sign in to comment.