mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 09:17:58 +00:00
Workaround mime types with removed dots
This commit is contained in:
parent
f496826fb9
commit
b854cbe8d3
1 changed files with 7 additions and 2 deletions
|
@ -160,13 +160,18 @@ public class EntityAttachment {
|
|||
if (extension == null)
|
||||
return type;
|
||||
|
||||
String gtype = MimeTypeMap.getSingleton()
|
||||
.getMimeTypeFromExtension(extension.toLowerCase(Locale.ROOT));
|
||||
|
||||
// Some servers remove dots from mime types
|
||||
if (gtype != null && gtype.replace(".", "").equals(type))
|
||||
return gtype;
|
||||
|
||||
if ("application/zip".equals(type) ||
|
||||
"application/octet-stream".equals(type)) {
|
||||
if ("log".equalsIgnoreCase(extension))
|
||||
return "text/plain";
|
||||
|
||||
String gtype = MimeTypeMap.getSingleton()
|
||||
.getMimeTypeFromExtension(extension.toLowerCase(Locale.ROOT));
|
||||
if (gtype == null || gtype.equals(type))
|
||||
return type;
|
||||
|
||||
|
|
Loading…
Reference in a new issue