hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Virtual host parameter on client is not inherited by requests
Date Wed, 29 Feb 2012 19:01:35 GMT
On Wed, 2012-02-29 at 17:19 +0000, Thomas Vestergaard wrote:
> Hi,
> 
> When setting the virtual host parameter (ClientPNames.VIRTUAL_HOST) on a client, 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.impl.client.DefaultRequestDirector.execute
> 
> HttpRequest orig = request;
> RequestWrapper origWrapper = wrapRequest(orig);
> origWrapper.setParams(params);
> HttpRoute origRoute = determineRoute(target, origWrapper, context);
> 
> virtualHost = (HttpHost) orig.getParams().getParameter(
>         ClientPNames.VIRTUAL_HOST);
> 
> Is this by design? Or is this a bug?
> 

This does look like a bug. Please raise a JIRA for this issue.

> A possible solution would be to merge the two collections of parameters, but I expect,
that some there needs to be a common understanding around which takes priority - parameters
on client or request.
> 

Request level parameters always take precedence those set at the client
level.

Oleg 

>  Best regards,
> Telenor
> 
> Thomas Vestergaard
> Ekstern konsulent
> Technology
> Frederikskaj, DK-1780. KĂžbenhavn V
> Tel: +45 52 18 92 18  // e-mail: cgethve@telenor.dk<mailto:cgethve@telenor.dk>
> Web: http://www.telenor.dk<http://www.telenor.dk/>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message