async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

Add missing property copies

Open seaswalker opened this issue 1 year ago • 0 comments

If we create a AsyncHttpClient instance with below code:

DefaultAsyncHttpClientConfig.Builder cfgBuilder = new DefaultAsyncHttpClientConfig.Builder();
cfgBuilder.setDisableHttpsEndpointIdentificationAlgorithm(true);
AsyncHttpClient client = AsyncHttpClientFactory.getAsyncHttpClient(cfgBuilder.build());

The actual behavior of getAsyncHttpClient method is to call the constructor of our customized AsyncHttpClient:

public CustomizedAsyncHttpClient(AsyncHttpClientConfig config) {
    DefaultAsyncHttpClientConfig.Builder builder = new DefaultAsyncHttpClientConfig.Builder(config));
    // customize the builder
    // ...
    this.client = new DefaultAsyncHttpClient(builder.build();
}

In this circumstance, the disableHttpsEndpointIdentificationAlgorithm option will be ignored, and further leads to unexpected bugs.

seaswalker avatar May 08 '24 06:05 seaswalker