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?

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.

 Best regards,
Telenor

Thomas Vestergaard
Ekstern konsulent
Technology
Frederikskaj, DK-1780. København V
Tel: +45 52 18 92 18  // e-mail: [email protected]<mailto:[email protected]>
Web: http://www.telenor.dk<http://www.telenor.dk/>

Reply via email to