Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38AEE9EBB for ; Wed, 29 Feb 2012 17:19:51 +0000 (UTC) Received: (qmail 21471 invoked by uid 500); 29 Feb 2012 17:19:50 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 21400 invoked by uid 500); 29 Feb 2012 17:19:50 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 21391 invoked by uid 99); 29 Feb 2012 17:19:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 17:19:50 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of CGETHVE@telenor.dk designates 216.32.180.30 as permitted sender) Received: from [216.32.180.30] (HELO VA3EHSOBE002.bigfish.com) (216.32.180.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 17:19:41 +0000 Received: from mail64-va3-R.bigfish.com (10.7.14.251) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 14.1.225.23; Wed, 29 Feb 2012 17:19:20 +0000 Received: from mail64-va3 (localhost [127.0.0.1]) by mail64-va3-R.bigfish.com (Postfix) with ESMTP id 4F7324E015C for ; Wed, 29 Feb 2012 17:19:20 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzc89bhc85dh62a3Kzz1202h1082kzz8275dhz2fh2a8h668h839h) X-Forefront-Antispam-Report: CIP:212.88.71.2;KIP:(null);UIP:(null);IPV:NLI;H:IFABEXCCAS02.int.sonofon.dk;RD:gateway.sonofon.dk;EFVD:NLI Received-SPF: pass (mail64-va3: domain of telenor.dk designates 212.88.71.2 as permitted sender) client-ip=212.88.71.2; envelope-from=CGETHVE@telenor.dk; helo=IFABEXCCAS02.int.sonofon.dk ;t.sonofon.dk ; Received: from mail64-va3 (localhost.localdomain [127.0.0.1]) by mail64-va3 (MessageSwitch) id 1330535958150562_23637; Wed, 29 Feb 2012 17:19:18 +0000 (UTC) Received: from VA3EHSMHS026.bigfish.com (unknown [10.7.14.244]) by mail64-va3.bigfish.com (Postfix) with ESMTP id 1FC3C120045 for ; Wed, 29 Feb 2012 17:19:18 +0000 (UTC) Received: from IFABEXCCAS02.int.sonofon.dk (212.88.71.2) by VA3EHSMHS026.bigfish.com (10.7.99.36) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 29 Feb 2012 17:19:14 +0000 Received: from IFABEXCMBX01.int.sonofon.dk ([fe80::c136:1cb2:5af6:fa3e]) by IFABEXCCAS02.int.sonofon.dk ([fe80::ecd9:44e0:c26c:b1c6%10]) with mapi id 14.02.0247.003; Wed, 29 Feb 2012 18:19:11 +0100 From: Thomas Vestergaard To: "httpclient-users@hc.apache.org" Subject: Virtual host parameter on client is not inherited by requests Thread-Topic: Virtual host parameter on client is not inherited by requests Thread-Index: Acz3BkAnhQ7+beDEQJa+JJ0OqnpyLw== Date: Wed, 29 Feb 2012 17:19:10 +0000 Message-ID: <09AD30D525666746A94BE7CC7347C46C02B41778@IFABEXCMBX01.int.sonofon.dk> Accept-Language: en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.98.201] Content-Type: multipart/alternative; boundary="_000_09AD30D525666746A94BE7CC7347C46C02B41778IFABEXCMBX01int_" MIME-Version: 1.0 X-OriginatorOrg: telenor.dk X-Virus-Checked: Checked by ClamAV on apache.org --_000_09AD30D525666746A94BE7CC7347C46C02B41778IFABEXCMBX01int_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, When setting the virtual host parameter (ClientPNames.VIRTUAL_HOST) on a cl= ient, it has no affect on actual virtual host used when the client executes= requests. It only looks at the parameters from the request object. In version 4.2.Alpha1 this is handled in line 408-414 in org.apache.http.im= pl.client.DefaultRequestDirector.execute HttpRequest orig =3D request; RequestWrapper origWrapper =3D wrapRequest(orig); origWrapper.setParams(params); HttpRoute origRoute =3D determineRoute(target, origWrapper, context); virtualHost =3D (HttpHost) orig.getParams().getParameter( ClientPNames.VIRTUAL_HOST); Is this by design? Or is this a bug? A possible solution would be to merge the two collections of parameters, bu= t I expect, that some there needs to be a common understanding around which= takes priority - parameters on client or request. Best regards, Telenor Thomas Vestergaard Ekstern konsulent Technology Frederikskaj, DK-1780. K=F8benhavn V Tel: +45 52 18 92 18 // e-mail: cgethve@telenor.dk Web: http://www.telenor.dk --_000_09AD30D525666746A94BE7CC7347C46C02B41778IFABEXCMBX01int_--