Description
Parameter values in the Content-Type message header are ignored if they only contain digits. This is a particular problem if a message contains an unquoted boundary string that contains only digits, it is not recognised as a valid boundary string and therefore the a Multipart object is created that fails the Message.isMultipart() test.
Attached test case shows the problem
The ContentTypeParser.jj source for value parsing is
String value() :
{Token t;}{
( t=<ATOKEN>
| t=<QUOTEDSTRING>
)
{ return t.image; }
}
however, if a value contains only digits, it is parsed as <DIGITS>, so will not be assigned.
Sensible solution seems to be to change the value() implementation in JavaCC source to include digit. Patch details
— ContentTypeParser.jj 2007-05-25 02:04:09.000000000 +1000
+++ ContentTypeParserFix.jj 2008-03-19 08:44:14.109375000 +1100
@@ -122,6 +122,7 @@
{Token t;}
{
( t=<ATOKEN>
+| t=<DIGITS>
t=<QUOTEDSTRING> ) { return t.image; } |