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

Jetty Producer always uses "Transfer-Encoding: chunked" header

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.17.6, 2.18.3
    • Fix Version/s: 2.18.4, 2.19.0
    • Component/s: camel-jetty
    • Labels:
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      The JettyHttpProducer is always sending requests with the header "Transfer-Encoding: chunked" even if the request received by the producer contains a Content-Length header. This is due to the JettyHttpProducer setting the request content as an InputStreamContentProvider which is hardcoded to always return -1 as its length. With the content set as an InputStreamContentProvider, when the content.getLength() is called in org.eclipse.jetty.client.HttpConnection ln 120, it is returned as -1. This causes the "Transfer-Encoding: chunked" header to be added at ln 129. Again in the org.eclipse.jetty.http.HttpGenerator class getLength() is called on the InputStreamContentProvider and since it is -1, the Content-Length header is not added to the request to be sent out.

        Attachments

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              mluckam Matthew Luckam
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: