blossom: hardcode some more common problematic extension types.

This commit is contained in:
fiatjaf
2026-02-11 11:41:28 -03:00
parent 3f52d10421
commit 7a4b71b39b
+11 -3
View File
@@ -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]
}