Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19899

camel-servlet: Multipart attachment processing does not work on Undertow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.1.0
    • camel-servlet
    • None
    • Unknown

    Description

      Something I observed with camel-servlet on Camel Quarkus. Undertow provides the Servlet support and the way that it's implementation of multipart attachment parsing works, assumes that the request body has not been read yet. Otherwise it will not attempt to process attachments.

      In DefaultHttpBinding.readyBody. The body is read first:

      https://github.com/apache/camel/blob/2509b469b5acfc46861643d01f0495133b690ddb/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java#L203

      And then attachments processed at the end:

      https://github.com/apache/camel/blob/2509b469b5acfc46861643d01f0495133b690ddb/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java#L230

      I tested moving attachment processing to the beginning and it made my test case work successfully.

      Not sure if that change could potentially screw things up non-undertow servlet containers?

      This same issue is probably present on Spring Boot with Undertow. I've not checked.

      Attachments

        Issue Links

          Activity

            People

              jamesnetherton James Netherton
              jamesnetherton James Netherton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: