hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vestergaard <CGET...@telenor.dk>
Subject Virtual host parameter on client is not inherited by requests
Date Wed, 29 Feb 2012 17:19:10 GMT

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);
HttpRoute origRoute = determineRoute(target, origWrapper, context);

virtualHost = (HttpHost) orig.getParams().getParameter(

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,

Thomas Vestergaard
Ekstern konsulent
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/>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message