From 8b808216457189f7c74200eff0a3c84568608539 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Mon, 19 May 2014 15:05:07 -0700 Subject: [PATCH] Add missing space in MIME header Also skip adding the filename if none exists b/13138456 Change-Id: I2e3d82c2a560049cfc3fcd0130f4c6d8020757a2 --- src/com/android/email/LegacyConversions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/LegacyConversions.java b/src/com/android/email/LegacyConversions.java index 5736b9d1d..76f757634 100644 --- a/src/com/android/email/LegacyConversions.java +++ b/src/com/android/email/LegacyConversions.java @@ -475,8 +475,8 @@ public class LegacyConversions { final Base64Body body = new Base64Body(content); final MimeBodyPart bp = new MimeBodyPart(body, contentType); bp.setHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64"); - bp.setHeader(MimeHeader.HEADER_CONTENT_DISPOSITION, "attachment;\n" - + "filename=\"" + filename + "\";" + bp.setHeader(MimeHeader.HEADER_CONTENT_DISPOSITION, "attachment;\n " + + (!TextUtils.isEmpty(filename) ? "filename=\"" + filename + "\";" : "") + "size=" + contentSize); if (contentId != null) { bp.setHeader(MimeHeader.HEADER_CONTENT_ID, contentId);