Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-139

[fileupload] separator of boundary doesnt match rfc1867 examples

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.1
    • None

    Description

      [fileupload]
      in class :
      package org.apache.commons.fileupload;
      public abstract class FileUploadBase {

      protected byte[] getBoundary(String contentType) {
      ParameterParser parser = new ParameterParser();
      parser.setLowerCaseNames(true);
      // Parameter parser can handle null input
      Map params = parser.parse(contentType, ';');
      String boundaryStr = (String) params.get("boundary");

      if (boundaryStr == null)

      { return null; }

      byte[] boundary;
      try

      { boundary = boundaryStr.getBytes("ISO-8859-1"); }

      catch (UnsupportedEncodingException e)

      { boundary = boundaryStr.getBytes(); }

      return boundary;
      }

      }

      String : Map params = parser.parse(contentType, ';');
      doesn't match http://www.ietf.org/rfc/rfc1867.txt document
      because in all examples:
      Content-type: multipart/form-data , boundary=AaB03x
      Content-type: multipart/form-data, boundary=AaB03x
      Content-type: multipart/mixed, boundary=BbC04y

      boundary separated by comma (but not semicolon)

      Attachments

        1. FILEUPLOAD-139.patch
          4 kB
          Henri Yandell

        Activity

          People

            Unassigned Unassigned
            martynas martynas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: