Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-181

Exception thrown is not descriptive, if content-type missing boundary parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.8
    • 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

      Attachments

        Activity

          People

            veithen Andreas Veithen
            delph Michael Kaye
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: