-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b20
There is suspicious place in the jdk.internal.net.http.AuthenticationFilter#getCredentials method:
InetSocketAddress proxyAddress;
if (proxy && (proxyAddress = req.proxy()) != null) {
// request sent to server through proxy
proxyAddress = req.proxy();
host = proxyAddress.getHostString();
port = proxyAddress.getPort();
protocol = "http"; // we don't support https connection to proxy
} else {
// direct connection to server or proxy
host = uri.getHost();
port = uri.getPort();
protocol = uri.getScheme();
}
`proxyAddress` variable is assigned inside `if` condition and then reassigned in the _then_ body.
One assignment is redundant and can be removed.
InetSocketAddress proxyAddress;
if (proxy && (proxyAddress = req.proxy()) != null) {
// request sent to server through proxy
proxyAddress = req.proxy();
host = proxyAddress.getHostString();
port = proxyAddress.getPort();
protocol = "http"; // we don't support https connection to proxy
} else {
// direct connection to server or proxy
host = uri.getHost();
port = uri.getPort();
protocol = uri.getScheme();
}
`proxyAddress` variable is assigned inside `if` condition and then reassigned in the _then_ body.
One assignment is redundant and can be removed.
- links to
-
Commit openjdk/jdk/550a1386
-
Review(master) openjdk/jdk/18880