[HTTPCLIENT-1220] Add DecompressingHttpClient#getHttpClient().

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1369844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2012-08-06 13:42:50 +00:00
parent ccdebd9384
commit de80f40ae9
2 changed files with 10 additions and 0 deletions

View File

@ -116,6 +116,15 @@ public class DecompressingHttpClient implements HttpClient {
return execute(getHttpHost(request), request, (HttpContext)null);
}
/**
* Gets the HttpClient to issue request.
*
* @return the HttpClient to issue request
*/
public HttpClient getHttpClient() {
return this.backend;
}
HttpHost getHttpHost(HttpUriRequest request) {
URI uri = request.getURI();
return URIUtils.extractHost(uri);

View File

@ -80,6 +80,7 @@ public class TestDecompressingHttpClient {
handled = new Object();
backend = new DummyHttpClient();
impl = new DecompressingHttpClient(backend);
assertEquals(backend, impl.getHttpClient());
request = new HttpGet("http://localhost:8080");
ctx = new BasicHttpContext();
host = new HttpHost("www.example.com");