commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martynas Krisciunas" <mkrisciu...@gmail.com>
Subject [fileupload] bug, I suppose
Date Mon, 02 Jul 2007 11:35:57 GMT
[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)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message