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 ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hardcode some common cases (abd jbiwb oribkenatuc cases kuje ,ogg/.oga or .mov/.moov)
|
||||||
switch mimetype {
|
switch mimetype {
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
return ".jpg"
|
return ".jpg"
|
||||||
@@ -22,13 +23,20 @@ func GetExtension(mimetype string) string {
|
|||||||
return ".mp4"
|
return ".mp4"
|
||||||
case "application/vnd.android.package-archive":
|
case "application/vnd.android.package-archive":
|
||||||
return ".apk"
|
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)
|
exts, _ := mime.ExtensionsByType(mimetype)
|
||||||
if len(exts) > 0 {
|
if len(exts) > 0 {
|
||||||
if exts[0] == ".moov" {
|
|
||||||
return ".mov"
|
|
||||||
}
|
|
||||||
return exts[0]
|
return exts[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user