Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Looking at org.apache.axiom.attachments.Attachments, if the contentType supplied is something like:
contentType="multipart/mixed;boundary=BOUNDARY"
then the value of this.boundary will be "--BOUNDARY".getBytes();
contentType="multipart/mixed"
then the value of this.boundary will be "--null".getBytes();
This will cause the parser to skip the entire stream and a :
throw new OMException("Mime parts not found. Stream ended while searching for the boundary"); exception will be thrown.
It would be useful if the code checked for a null boundary and threw a more descriptive error – the issue is not that the stream ended prematurely, nor that there was no boundary, but that the boundary parameter was missing from the ContentType.
This applies against 1.2.5 and 1.2.6