Skip to content

Commit 271c355

Browse files
authored
should lowercase ext when looking up in staticmimetypemap (#2468)
1 parent f99bad8 commit 271c355

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/util/fileutil/fileutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func DetectMimeType(path string, fileInfo fs.FileInfo, extended bool) string {
8787
if fileInfo.Mode()&os.ModeDevice == os.ModeDevice {
8888
return "block-special"
8989
}
90-
ext := filepath.Ext(path)
90+
ext := strings.ToLower(filepath.Ext(path))
9191
if mimeType, ok := StaticMimeTypeMap[ext]; ok {
9292
return mimeType
9393
}
@@ -136,7 +136,7 @@ func DetectMimeTypeWithDirEnt(path string, dirEnt fs.DirEntry) string {
136136
return "block-special"
137137
}
138138
}
139-
ext := filepath.Ext(path)
139+
ext := strings.ToLower(filepath.Ext(path))
140140
if mimeType, ok := StaticMimeTypeMap[ext]; ok {
141141
return mimeType
142142
}

0 commit comments

Comments
 (0)