fix: incorrect content-type of apk files (close #5385)

This commit is contained in:
Andy Hsu
2023-11-06 18:20:25 +08:00
parent da1c7a4c23
commit 4355dae491
2 changed files with 8 additions and 0 deletions

View File

@ -163,8 +163,15 @@ func GetObjType(filename string, isDir bool) int {
return GetFileType(filename)
}
var extraMimeTypes = map[string]string{
".apk": "application/vnd.android.package-archive",
}
func GetMimeType(name string) string {
ext := path.Ext(name)
if m, ok := extraMimeTypes[ext]; ok {
return m
}
m := mime.TypeByExtension(ext)
if m != "" {
return m