jersey
  1. jersey
  2. JERSEY-1085

Multipart/form-data POST having a quoted boundary parameter in the Content-Type header fails.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.12
    • Fix Version/s: 2.0-m07, 2.0
    • Component/s: media
    • Labels:
      None

      Description

      Jersey returns HTTP status 400 when POST-ing a multipart/form-data having a quoted boundary parameter in the Content-Type header:
      Content-Type: multipart/form-data;boundary="MrmiiyyJEqRYcIJyun5tMVIz70NuQ_nfD"
      and use MrmiiyyJEqRYcIJyun5tMVIz70NuQ_nfD (without quotes) to separate the parts.

      Use com.sun.jersey.spi.spring.container.servlet.SpringServlet.
      Exception is thrown in jersey class com.sun.jersey.multipart.impl.MultiPartReaderClientSide, method readMultiPart. (org.jvnet.mimepull.MIMEParsingException: Missing start boundary).

      RFC2046 states that quoted boundary values are permitted (http://www.ietf.org/rfc/rfc2046.txt):
      "
      WARNING TO IMPLEMENTORS: The grammar for parameters on the Content-
      type field is such that it is often necessary to enclose the boundary
      parameter values in quotes on the Content-type line. This is not
      always necessary, but never hurts. Implementors should be sure to
      study the grammar carefully in order to avoid producing invalid
      Content-type fields. Thus, a typical "multipart" Content-Type header
      field might look like this:
      Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p

      But the following is not valid:
      Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p
      (because of the colon) and must instead be represented as
      Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p"
      ".

        Activity

        Hide
        Michal Gajdos added a comment -

        This issue does not occur in Jersey2. Resolving as 'Cannot Reproduce'.

        Show
        Michal Gajdos added a comment - This issue does not occur in Jersey2. Resolving as 'Cannot Reproduce'.

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            voinescu_mihaela
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours Time Not Required
              2h