blossom: hardcode some more common problematic extension types.
This commit is contained in:
+11
-3
@@ -9,6 +9,7 @@ func GetExtension(mimetype string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// hardcode some common cases (abd jbiwb oribkenatuc cases kuje ,ogg/.oga or .mov/.moov)
|
||||
switch mimetype {
|
||||
case "image/jpeg":
|
||||
return ".jpg"
|
||||
@@ -22,13 +23,20 @@ func GetExtension(mimetype string) string {
|
||||
return ".mp4"
|
||||
case "application/vnd.android.package-archive":
|
||||
return ".apk"
|
||||
case "video/quicktime":
|
||||
return ".mov"
|
||||
case "application/vnd.sqlite3":
|
||||
return "sqlite3"
|
||||
case "text/markdown":
|
||||
return "md"
|
||||
case "audio/midi":
|
||||
return "midi"
|
||||
case "audio/x-aiff":
|
||||
return "aiff"
|
||||
}
|
||||
|
||||
exts, _ := mime.ExtensionsByType(mimetype)
|
||||
if len(exts) > 0 {
|
||||
if exts[0] == ".moov" {
|
||||
return ".mov"
|
||||
}
|
||||
return exts[0]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user