HttpHost target = null;
URI requestURI = request.getURI();
if (requestURI.isAbsolute()) {
if (requestURI.getHost() == null) {
throw new ClientProtocolException(
"URI does not specify a valid host name: " + requestURI);
}
target = new HttpHost(requestURI.getHost(), requestURI.getPort(), requestURI.getScheme());
// TODO use URIUtils#extractTarget once it becomes available
}