Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove check #5106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/http/impl/HttpClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private EndpointProvider<EndpointKey, SharedClientHttpStreamEndpoint> httpEndpoi
ProxyOptions proxyOptions = key.proxyOptions;
if (proxyOptions != null && !key.ssl && proxyOptions.getType() == ProxyType.HTTP) {
SocketAddress server = SocketAddress.inetSocketAddress(proxyOptions.getPort(), proxyOptions.getHost());
key = new EndpointKey(key.ssl, key.sslOptions, proxyOptions, server, key.authority);
key = new EndpointKey(false, key.sslOptions, proxyOptions, server, key.authority);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more explicit than key.ssl , and we are negating it in line 183

proxyOptions = null;
}
HttpChannelConnector connector = new HttpChannelConnector(HttpClientImpl.this, netClient, key.sslOptions, proxyOptions, metrics, options.getProtocolVersion(), key.ssl, options.isUseAlpn(), key.authority, key.server);
Expand Down Expand Up @@ -431,7 +431,7 @@ private HttpClientRequest createRequest(
if (!ABS_URI_START_PATTERN.matcher(u).find()) {
int defaultPort = 80;
String addPort = (authority.port() != -1 && authority.port() != defaultPort) ? (":" + authority.port()) : "";
u = (useSSL == Boolean.TRUE ? "https://" : "http://") + authority.host() + addPort + requestURI;
u = "http://" + authority.host() + addPort + requestURI;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not needed because in line 430, we're checking !useSSL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vietj Do you know what was the intention of this line?

}
}
HttpClientRequest request = createRequest(stream);
Expand Down
Loading