1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-15 22:15:15 -05:00

If android's content-type lookup says "why yes, I have no idea what that

is", at least look at our local list
This commit is contained in:
Jesse Vincent 2011-02-07 20:33:46 -05:00
parent 938a01630e
commit bb1e66c70d

View File

@ -1178,7 +1178,9 @@ public class MimeUtility {
extension = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}
if (returnedType != null) {
// If the MIME type set by the user's mailer is application/octet-stream, try to figure
// out whether there's a sane file type extension.
if (returnedType != null && !DEFAULT_ATTACHMENT_MIME_TYPE.equalsIgnoreCase(returnedType)) {
return returnedType;
} else if (extension != null) {
for (String[] contentTypeMapEntry : MIME_TYPE_BY_EXTENSION_MAP) {