malliaridis commented on code in PR #2787:
URL: https://github.com/apache/solr/pull/2787#discussion_r1812964775
##########
solr/core/src/java/org/apache/solr/cli/PostTool.java:
##########
@@ -330,15 +331,24 @@ public void runImpl(CommandLine cli) throws Exception {
}
solrUrl = SolrCLI.normalizeSolrUrl(solrUrl, true, hostContext) +
hostContext;
- String url = solrUrl + "/" + cli.getOptionValue("name") + "/update";
- solrUpdateUrl = new URI(url);
+
+ solrUpdateUrl =
+ UriBuilder.fromUri(SolrCLI.normalizeSolrUrl(solrUrl, true,
hostContext))
+ .path(hostContext)
Review Comment:
The `hostContext` is indeed barely documented. The user should be able to
pass a custom `hostContext` as you described via the system properties, and the
`SolrCLI` class executes some custom logic to preserve these arguments as well
(due to special treatment of `-D`).
I also avoided to make any changes in the bahavior and only replaced the
concatenation with a URI builder.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]