hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r542253 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: client/HttpClient.java impl/client/DefaultClientRequestDirector.java
Date Mon, 28 May 2007 15:56:36 GMT
Author: olegk
Date: Mon May 28 08:56:35 2007
New Revision: 542253

URL: http://svn.apache.org/viewvc?view=rev&rev=542253
Log:
Always add a Host request header to CONNECT requests

Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java?view=diff&rev=542253&r1=542252&r2=542253
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
Mon May 28 08:56:35 2007
@@ -33,16 +33,12 @@
 
 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;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.conn.ClientConnectionManager;
-
-
 
 /**
  * Interface for an HTTP client.

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?view=diff&rev=542253&r1=542252&r2=542253
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
Mon May 28 08:56:35 2007
@@ -537,6 +537,7 @@
         throws HttpException, IOException {
 
         HttpHost proxy = route.getProxyHost();
+        HttpHost target = route.getTargetHost();
         HttpResponse response = null;
         
         boolean done = false;
@@ -554,6 +555,7 @@
             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();



Mime
View raw message