cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnaud Masciotra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6180) Bad parse of Multipart request
Date Sat, 03 Jan 2015 19:54:35 GMT

    [ https://issues.apache.org/jira/browse/CXF-6180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263605#comment-14263605
] 

Arnaud Masciotra commented on CXF-6180:
---------------------------------------

I was using IntelliJ plug-in RESTClient in order to create the request.

And I did check the content with fiddler proxy (and the captured request was the one I gave
in this bug), so the request is correct ... It's not a broken payload.

I will try to produce a test case as soon as possible.

> 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
>
> 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)

Mime
View raw message