The documentation for ClientPNames.VIRTUAL_HOST says it: defines the virtual host name to be used in the <literal>Host</literal> header instead of the physical host name. This parameter expects a value of type <classname>HttpHost</classname>.
In HC3.1, AFAICT the equivalent to this parameter is the method HttpMethodParams.setVirtualHost(String hostname), which only accepts a String for the hostname. The HC3.1 code automatically appends the appropriate port for the connection if required (it does not append :80 for http requests). Which is fine. However in HC4, AFAICT the HttpHost is used exactly as is when generating the Host header - the correct port has to be provided in the HttpHost instance (or omitted in the default case). Also the documentation of the VIRTUAL_HOST parameter does not mention anything about needing to set the port - it only mentions the hostname. So is the documentation correct? i.e. should the code automatically add the correct port number to the generated Host header? Or is the code correct, in which case the documentation needs to be updated. If the existing code is correct, then I think it would make sense to provide a helper method to create an HttpHost instance with the correct port value. S. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
