You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Patrick Barry (Jira)" <ji...@apache.org> on 2022/10/19 15:37:00 UTC

[jira] [Comment Edited] (HTTPCLIENT-2239) setContentCompressionEnabled(true) does not work

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17620417#comment-17620417 ] 

Patrick Barry edited comment on HTTPCLIENT-2239 at 10/19/22 3:36 PM:
---------------------------------------------------------------------

Let me take a step back. 

We are trying to use CloseableHttpAsyncClient.  We are using setDefaultRequestConfig() to enable compression by default. This property has no effect.  If it is not supported, why is .setContentCompressionEnabled(true) still available?
{code:java}
CloseableHttpAsyncClient client = HttpAsyncClients.custom()
.disableAuthCaching()
.disableCookieManagement()
.setVersionPolicy(FORCE_HTTP_1)
.setDefaultRequestConfig(RequestConfig.custom()
.setContentCompressionEnabled(true)
.build()){code}


was (Author: patrickjamesbarry):
Let me take a step back. 

We are trying to use CloseableHttpAsyncClient.  We are using setDefaultRequestConfig() to enable compression by default. This property has no effect.  If it is not supported, why is .setContentCompressionEnabled(true) still available?
CloseableHttpAsyncClient client = HttpAsyncClients.custom()
        .disableAuthCaching()
        .disableCookieManagement()
        .setVersionPolicy(FORCE_HTTP_1)
        .setDefaultRequestConfig(RequestConfig.custom()
                .setContentCompressionEnabled(true)
                .build())
        .build();

> setContentCompressionEnabled(true) does not work
> ------------------------------------------------
>
>                 Key: HTTPCLIENT-2239
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2239
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (async)
>    Affects Versions: 5.1.3
>            Reporter: Patrick Barry
>            Priority: Major
>
> {code:java}
> CloseableHttpAsyncClient client = HttpAsyncClients.custom()
>         .disableAuthCaching()
>         .disableCookieManagement()
>         .setVersionPolicy(FORCE_HTTP_1)
>         .setDefaultRequestConfig(RequestConfig.custom()
>                 .setContentCompressionEnabled(true)
>                 .build())
>         .build(); 
> We are migrating away from old apache sync client in favor of CloseableHttpAsyncClient. However, the new async client is not respecting the client configuration of contentCompression.  The old client would call down into ProtocolExec -> httpProcessor.process(request, context) -> which would go into interceptor RequestAcceptEncoding and if you wanted compression, it would add the Accept-Encoding header.  This new client is not doing that.    {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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