From: adam Date: Tue, 17 Aug 2004 23:14:55 +0000 (+0000) Subject: make MIME more tolerant of content-types without slashes X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=06508d668af7a21ddb5515e3515c70bc00adb809;p=org.ibex.mail.git make MIME more tolerant of content-types without slashes darcs-hash:20040817231455-5007d-96d3fcb52b891e5956d4f56860365c5752e5808a.gz --- diff --git a/src/org/ibex/mail/MIME.java b/src/org/ibex/mail/MIME.java index 8251a94..e47b056 100644 --- a/src/org/ibex/mail/MIME.java +++ b/src/org/ibex/mail/MIME.java @@ -88,7 +88,10 @@ public class MIME { this.transferEncoding = transferEncoding; if (header == null) { type="text"; subtype="plain"; charset="us-ascii"; alternative=false; composite=false; return; } header = header.trim(); - if (header.indexOf('/') == -1) throw new MailException.Malformed("content-type lacks a forward slash: \""+header+"\""); + if (header.indexOf('/') == -1) { + Log.warn(this, "content-type lacks a forward slash: \""+header+"\""); + header = "text/plain"; + } type = header.substring(0, header.indexOf('/')).toLowerCase(); header = header.substring(header.indexOf('/') + 1); subtype = (header.indexOf(';') == -1) ? header.toLowerCase() : header.substring(0, header.indexOf(';')).toLowerCase();