Always add a Host request header to CONNECT requests

git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@542253 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2007-05-28 15:56:35 +00:00
parent 7813fd1197
commit c883d7d451
2 changed files with 2 additions and 4 deletions

View File

@ -33,8 +33,6 @@ package org.apache.http.client;
import java.io.IOException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpException;
import org.apache.http.params.HttpParams;
@ -42,8 +40,6 @@ import org.apache.http.protocol.HttpContext;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.ClientConnectionManager;
/**
* Interface for an HTTP client.
* HTTP clients encapsulate a smorgasbord of objects required to

View File

@ -537,6 +537,7 @@ public class DefaultClientRequestDirector
throws HttpException, IOException {
HttpHost proxy = route.getProxyHost();
HttpHost target = route.getTargetHost();
HttpResponse response = null;
boolean done = false;
@ -554,6 +555,7 @@ public class DefaultClientRequestDirector
if (agent != null) {
connect.addHeader(HTTP.USER_AGENT, agent);
}
connect.addHeader(HTTP.TARGET_HOST, target.toHostString());
AuthScheme authScheme = this.proxyAuthState.getAuthScheme();
AuthScope authScope = this.proxyAuthState.getAuthScope();