mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-19 16:37:06 +00:00
HTTPCLIENT-1285: request configuration in the context to remain unchanged if not explicitly overridden by the request
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1426771 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
712cafd1e9
commit
c2dd3ccc44
@ -30,6 +30,7 @@
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@ -87,7 +88,7 @@ class InternalHttpClient extends CloseableHttpClient {
|
||||
private final CredentialsProvider credentialsProvider;
|
||||
private final RequestConfig defaultConfig;
|
||||
private final List<Closeable> closeables;
|
||||
private final HttpParams params;
|
||||
private final BasicHttpParams params;
|
||||
|
||||
public InternalHttpClient(
|
||||
final ClientExecChain execChain,
|
||||
@ -173,9 +174,14 @@ protected CloseableHttpResponse doExecute(
|
||||
config = this.defaultConfig;
|
||||
}
|
||||
if (config == null) {
|
||||
config = HttpClientParamConfig.getRequestConfig(params);
|
||||
Set<String> names = params.getNames();
|
||||
if (!names.isEmpty()) {
|
||||
config = HttpClientParamConfig.getRequestConfig(params);
|
||||
}
|
||||
}
|
||||
if (config != null) {
|
||||
localcontext.setRequestConfig(config);
|
||||
}
|
||||
localcontext.setRequestConfig(config);
|
||||
return this.execChain.execute(route, wrapper, localcontext, execAware);
|
||||
} catch (HttpException httpException) {
|
||||
throw new ClientProtocolException(httpException);
|
||||
|
Loading…
x
Reference in New Issue
Block a user