Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
4.2.2
-
None
-
None
Description
The following code in DefaultRequestDirector is incorrect:
// HTTPCLIENT-1092 - add the port if necessary if (virtualHost != null && virtualHost.getPort() == -1) { int port = target.getPort(); if (port != -1){ virtualHost = new HttpHost(virtualHost.getHostName(), port, virtualHost.getSchemeName()); } }
The reason it is incorrect is that if the target has not been specified in the URL, then an NPE will result. The target is resolved later in the same method in that case.