cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6180) Bad parse of Multipart request
Date Wed, 14 Jan 2015 21:15:35 GMT

     [ https://issues.apache.org/jira/browse/CXF-6180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin updated CXF-6180:
----------------------------------
    Attachment: cxf6180.txt

Hi Dan,
I've prototyped a patch but I've really no confidence it can help at all, just blindly replaced
'2' with the count. I'm not even 100% sure this is where the restriction is :-)
Have a look please when you have a chance, if it proves too messy/sensitive to have CR only
supported then lets not worry about it :-). Otherwise supporting non-compliant producers might
make it simpler to test in some cases - may be a property can be introduced that can be passed
to MimeBodyPartInputStream.

> 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: cxf6180.txt, 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)

Mime
View raw message