Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA03A171D3 for ; Sat, 3 Jan 2015 21:07:33 +0000 (UTC) Received: (qmail 77485 invoked by uid 500); 3 Jan 2015 21:07:34 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 77446 invoked by uid 500); 3 Jan 2015 21:07:34 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 77435 invoked by uid 99); 3 Jan 2015 21:07:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jan 2015 21:07:34 +0000 Date: Sat, 3 Jan 2015 21:07:34 +0000 (UTC) From: "Arnaud Masciotra (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6180) Bad parse of Multipart request MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263636#comment-14263636 ] Arnaud Masciotra commented on CXF-6180: --------------------------------------- [~sergey_beryozkin] I attach a maven project for the issue ... If you need help, tell me . Thx > Bad parse of Multipart request > ------------------------------ > > Key: CXF-6180 > URL: https://issues.apache.org/jira/browse/CXF-6180 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.0.3 > Environment: Java 1.7 > Reporter: Arnaud Masciotra > Attachments: issue-cxf-6180.zip > > > A valid HTTP request POST with Multipart get an HTTP ERROR 400 Bad request, because the content is not well parsed by CXF > -------------------------------- > POST http://localhost:8080/ws/test/test HTTP/1.1 > Content-Length: 196 > Content-Type: multipart/form-data; boundary=MultiPart; charset=UTF-8 > Host: localhost:8080 > Connection: Keep-Alive > User-Agent: Apache-HttpClient/4.0.1 (java 1.5) > Expect: 100-Continue > --MultiPart > Content-Disposition: form-data; name="foo" > Content-Type: text/plain > Foo Content > --MultiPart > Content-Disposition: form-data; name="bar" > Content-Type: text/html > Bar Content > --MultiPart > -------------------------------- > Server side code : > @Path("/test") > public class TestWebService > { > @POST > @Path("/test") > @Consumes(MediaType.MULTIPART_FORM_DATA) > public void test(@Multipart(value = "foo") String foo, @Multipart(value = "bar") String bar) { > // DO NOTHING BECAUSE OF THE HTTP ERROR 400 ! > } > } > -------------------------------- > The cause is the first Header of the Second Attachment is not well read ... > The C of "Content-Disposition" is missing ! > Then the method getContentDisposition() of the second Attachment is always null ... > headers ArrayList in AttanchmentImpl isn't well construct ... > If you add a useless character in front of "Content-Disposition" header, then I got a valid response (in this case, HTTP 204) -- This message was sent by Atlassian JIRA (v6.3.4#6332)