You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Guillaume Castagnino (JIRA)" <ji...@apache.org> on 2012/05/31 10:06:22 UTC

[jira] [Created] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Guillaume Castagnino created HTTPCLIENT-1199:
------------------------------------------------

             Summary: DecompressingHttpClient strips POST content from request
                 Key: HTTPCLIENT-1199
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.2 Final
         Environment: Ubuntu / openjdk-7
            Reporter: Guillaume Castagnino


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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286856#comment-13286856 ] 

Jon Moore commented on HTTPCLIENT-1199:
---------------------------------------

Nevermind, I see the problem. The followup (redirected) requests don't get the Accept-Encoding headers added. I do think the right way through this is to write a RedirectFollowingHttpClient so that you can wire them all up as I outlined above. I can start working on that next, after doing the short-term patch fix.



                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287400#comment-13287400 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1199:
-----------------------------------------------

@Jon

I committed an intermediate fix that should enable DecompressingHttpClient to handle entity enclosing requests correctly. 

The redirect issue, unfortunately, may not have an easy fix I am afraid. Even if redirect handling logic was factored out into a separate decorator class it would still prevent the DecompressingHttpClient from being able to work 100% transparently with any _arbitrary_ backend. For the proposed scheme to work the user would also need to explicitly disable redirect handling by the backend or the decorator would somehow need to disable redirect handling at the runtime. If we took the latter approach we might as well simply insert an additional protocol interceptor into the protocol processing chain of the backend.

Oleg 
                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Guillaume Castagnino (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286410#comment-13286410 ] 

Guillaume Castagnino commented on HTTPCLIENT-1199:
--------------------------------------------------

To illustrate this, I made a test with this change, that fixes my issue. Now my POST requests are correctly processed:
$ diff -u ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java.orig ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java                                                                                            
--- ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java.orig    2012-05-31 10:39:49.698192187 +0200
+++ ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java 2012-05-31 10:39:57.202038414 +0200
@@ -125,9 +125,8 @@
             HttpContext context) throws IOException, ClientProtocolException {
         try {
             if (context == null) context = new BasicHttpContext();
-            HttpRequest wrapped = new RequestWrapper(request);
-            acceptEncodingInterceptor.process(wrapped, context);
-            HttpResponse response = backend.execute(target, wrapped, context);
+            acceptEncodingInterceptor.process(request, context);
+            HttpResponse response = backend.execute(target, request, context);
             contentEncodingInterceptor.process(response, context);
             if (Boolean.TRUE.equals(context.getAttribute(ResponseContentEncoding.UNCOMPRESSED))) {
                 response.removeHeaders("Content-Length");
                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286632#comment-13286632 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1199:
-----------------------------------------------

DecompressingHttpClient in its present form is also unable to decompress content entities on redirects if redirects are handled internally by the decorated backend.  

http://markmail.org/message/cjbwgks63lhzmbbu

This looks like a much bigger problem to me which I currently do not see an easy fix for.

Oleg
                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Guillaume Castagnino (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Castagnino updated HTTPCLIENT-1199:
---------------------------------------------

    Attachment: fix-wrapper.patch

To illustrate this, I made a test with this change, that fixes my issue. Now my POST requests are correctly processed
                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286641#comment-13286641 ] 

Jon Moore commented on HTTPCLIENT-1199:
---------------------------------------

Yes, there's a similar problem here with redirects and the CachingHttpClient decorator too. One possibility is to pull the redirect handling out into its own decorator as well. Then I think you can wire things up as: RedirectDecorator -> CompressionDecorator -> CachingDecorator -> DefaultHttpClient.

                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Guillaume Castagnino (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Castagnino updated HTTPCLIENT-1199:
---------------------------------------------

    Comment: was deleted

(was: To illustrate this, I made a test with this change, that fixes my issue. Now my POST requests are correctly processed:
$ diff -u ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java.orig ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java                                                                                            
--- ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java.orig    2012-05-31 10:39:49.698192187 +0200
+++ ./httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java 2012-05-31 10:39:57.202038414 +0200
@@ -125,9 +125,8 @@
             HttpContext context) throws IOException, ClientProtocolException {
         try {
             if (context == null) context = new BasicHttpContext();
-            HttpRequest wrapped = new RequestWrapper(request);
-            acceptEncodingInterceptor.process(wrapped, context);
-            HttpResponse response = backend.execute(target, wrapped, context);
+            acceptEncodingInterceptor.process(request, context);
+            HttpResponse response = backend.execute(target, request, context);
             contentEncodingInterceptor.process(response, context);
             if (Boolean.TRUE.equals(context.getAttribute(ResponseContentEncoding.UNCOMPRESSED))) {
                 response.removeHeaders("Content-Length");)
    
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-1199.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2.1

The problem with handling of entity enclosing requests has been fixed. 

The redirect problem is a massively more complex one and its fix will require a significant refactoring. For the time being one can avoid problems with redirects by adding protocol interceptors directly to the protocol processing chain of the DefaultHttpClient instead of using DecompressingHttpClient decorator.

---
DefaultHttpClient httpClient = new DefaultHttpClient();
httpClient.addRequestInterceptor(new RequestAcceptEncoding());
httpClient.addResponseInterceptor(new ResponseContentEncoding());
---

Oleg
                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>             Fix For: 4.2.1
>
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1199) DecompressingHttpClient strips POST content from request

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286854#comment-13286854 ] 

Jon Moore commented on HTTPCLIENT-1199:
---------------------------------------

@Oleg:

One possibility I see here is to address the non-redirect case by extending RequestWrapper to implement HttpEntityEnclosingRequest and using a pointer to the original request's entity if it has one. I've got a patch that will do this, although I recall you weren't crazy about the RequestWrapper in general, so I didn't want to commit it without some input.

Can you explain why the DecompressingHttpClient can't decompress entities on redirects? I'm about to go investigate this to find out, but wonder what it is that you saw as the bigger problem.



                
> DecompressingHttpClient strips POST content from request
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-1199
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1199
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>         Environment: Ubuntu / openjdk-7
>            Reporter: Guillaume Castagnino
>         Attachments: fix-wrapper.patch
>
>
> 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 ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org