garydgregory commented on code in PR #634: URL: https://github.com/apache/httpcomponents-client/pull/634#discussion_r2070198100
########## httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/InternalHttpClient.java: ########## @@ -161,11 +161,15 @@ protected CloseableHttpResponse doExecute( setupContext(localcontext); final HttpHost resolvedTarget = target != null ? target : RoutingSupport.determineHost(request); - if (request.getScheme() == null) { - request.setScheme(resolvedTarget.getSchemeName()); - } - if (request.getAuthority() == null) { - request.setAuthority(new URIAuthority(resolvedTarget)); + if (resolvedTarget != null) { Review Comment: HI @arturobernalg 👋 We could throw a more precise exception using `Objects.requireNonNull(...)`, which would reduce the nesting. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org