Return-Path: Delivered-To: apmail-jakarta-httpclient-dev-archive@www.apache.org Received: (qmail 47302 invoked from network); 15 May 2006 19:02:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 May 2006 19:02:42 -0000 Received: (qmail 22498 invoked by uid 500); 15 May 2006 19:02:37 -0000 Delivered-To: apmail-jakarta-httpclient-dev-archive@jakarta.apache.org Received: (qmail 22410 invoked by uid 500); 15 May 2006 19:02:37 -0000 Mailing-List: contact httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "HttpClient Project" Reply-To: "HttpClient Project" Delivered-To: mailing list httpclient-dev@jakarta.apache.org Received: (qmail 22278 invoked by uid 99); 15 May 2006 19:02:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2006 12:02:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2006 12:02:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D273541000C for ; Mon, 15 May 2006 19:02:09 +0000 (GMT) Message-ID: <21231903.1147719729859.JavaMail.jira@brutus> Date: Mon, 15 May 2006 19:02:09 +0000 (GMT+00:00) From: "Oleg Kalnichevski (JIRA)" To: httpclient-dev@jakarta.apache.org Subject: [jira] Updated: (HTTPCLIENT-541) Redesign virtual host API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HTTPCLIENT-541?page=all ] Oleg Kalnichevski updated HTTPCLIENT-541: ----------------------------------------- Fix Version: 4.0 Alpha 1 (was: 4.0 Final) > Redesign virtual host API > ------------------------- > > Key: HTTPCLIENT-541 > URL: http://issues.apache.org/jira/browse/HTTPCLIENT-541 > Project: HttpComponents HttpClient > Type: Improvement > Components: HttpClient > Versions: Nightly Builds > Environment: Operating System: other > Platform: Other > Reporter: Peter Bryant > Assignee: HttpClient Dev > Priority: Minor > Fix For: 4.0 Alpha 1 > > HttpClient is ignoring an explicity set host. e.g. if you set the host like > client.getHostConfiguration().setHost("127.0.0.1") then execute a method looking > up say http://google.com then the program will connect to google.com rather than > the localhost. > The fix that works for me: > diff -Naur > ../../t2/commons-httpclient/src/java/org/apache/commons/httpclient/HttpClient.java > src/java/org/apache/commons/httpclient/HttpClient.java > --- > ../../t2/commons-httpclient/src/java/org/apache/commons/httpclient/HttpClient.java > 2005-12-22 01:06:54.000000000 +1300 > +++ src/java/org/apache/commons/httpclient/HttpClient.java 2005-12-22 > 19:13:30.000000000 +1300 > @@ -383,7 +383,9 @@ > if (hostconfig == defaulthostconfig || uri.isAbsoluteURI()) { > // make a deep copy of the host defaults > hostconfig = new HostConfiguration(hostconfig); > - if (uri.isAbsoluteURI()) { > + // if the host is explicity set already (e.g. to the IP of the virtual host > + // on which we are executing a method), just leave it > + if (uri.isAbsoluteURI() && hostconfig.getHost()==null) { > hostconfig.setHost(uri); > } > Note: Why do we care that the host is specified? Why not just use the uri > authority? In my case I have a virtual host running on several servers/IPs and > I need to make sure the request goes through to a specific IP and the response > that comes back is for the virtual host I am testing. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org