|
@@ -4,6 +4,7 @@ import (
|
|
|
"fmt"
|
|
|
"github.com/h2non/filetype"
|
|
|
"github.com/h2non/filetype/types"
|
|
|
+ "strings"
|
|
|
"sync"
|
|
|
)
|
|
|
|
|
@@ -54,9 +55,10 @@ func CheckFileType(buf []byte, sourceType SourceType, exactFileType []string, fi
|
|
|
}
|
|
|
}
|
|
|
func exactFile(exactFileType []string, fileKind types.Type, fileExt string) bool {
|
|
|
+ lowCase := strings.ToLower(fileExt)
|
|
|
for _, fileType := range exactFileType {
|
|
|
if fileKind.Extension == fileType {
|
|
|
- if fileExt != "" && (fileExt == fmt.Sprintf(".%s", fileKind.Extension) || (fileExt == ".jpeg" && fileKind.Extension == "jpg")) {
|
|
|
+ if lowCase != "" && (lowCase == fmt.Sprintf(".%s", fileKind.Extension) || (lowCase == ".jpeg" && fileKind.Extension == "jpg")) {
|
|
|
return true
|
|
|
}
|
|
|
return false
|