Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1199

DecompressingHttpClient strips POST content from request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2 Final
    • 4.2.1
    • HttpClient (classic)
    • None
    • Ubuntu / openjdk-7

    Description

      When upgrading from HttpClient 4.1 to HttpClient 4.2, I have to migrate my ContentEncodingHttpClient to a decorated DecompressingHttpClient.

      But there is a problem with HttpPost requests : the POST content is missing.

      Looking at the DecompressingHttpClient code : http://hc.apache.org/httpcomponents-client-ga/httpclient/clover/org/apache/http/impl/client/DecompressingHttpClient.html, the issue seems to be that DecompressingHttpClient use a HttpRequest wrapped by a RequestWrapper at line 130 to execute. But this wrapper only clone headers and params, disregarding the request type, so the entity is not cloned.
      When feeding the DecompressingHttpClient with a HttpPost request, this leads to partial request with no entity : over the network, I get POST requests with no content !

      Solution should be to stop using a wrapped request ?

      Attachments

        1. fix-wrapper.patch
          1 kB
          Guillaume Castagnino

        Activity

          People

            Unassigned Unassigned
            guilc Guillaume Castagnino
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: