From 4667a05c420b72a8d3c509a9e3c1cb8ab0ff92cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 29 Jun 2015 07:54:58 +0200 Subject: Guess mime type like support libs FileProvider --- .../org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'OpenKeychain') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 6a85ce251..7a4c85178 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -70,7 +70,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.URLConnection; import java.security.SignatureException; import java.util.Date; import java.util.Iterator; @@ -676,8 +675,6 @@ public class PgpDecryptVerify extends BaseOperation || literalData.getFormat() == PGPLiteralData.UTF8) { mimeType = "text/plain"; } else { - // TODO: better would be: https://github.com/open-keychain/open-keychain/issues/753 - // try to guess from file ending String extension = MimeTypeMap.getFileExtensionFromUrl(originalFilename); if (extension != null) { @@ -685,10 +682,7 @@ public class PgpDecryptVerify extends BaseOperation mimeType = mime.getMimeTypeFromExtension(extension); } if (mimeType == null) { - mimeType = URLConnection.guessContentTypeFromName(originalFilename); - } - if (mimeType == null) { - mimeType = "*/*"; + mimeType = "application/octet-stream"; } } -- cgit v1.2.3