malliaridis commented on code in PR #2787:
URL: https://github.com/apache/solr/pull/2787#discussion_r1812973848
##########
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)
+ .path(cli.getOptionValue("name"))
+ .path("update")
+ .build();
} else if (cli.hasOption("solr-update-url")) {
String url = cli.getOptionValue("solr-update-url");
solrUpdateUrl = new URI(url);
} else if (cli.hasOption("name")) {
- String url = SolrCLI.getDefaultSolrUrl() + "/solr/" +
cli.getOptionValue("name") + "/update";
- solrUpdateUrl = new URI(url);
+ solrUpdateUrl =
+ UriBuilder.fromUri(SolrCLI.getDefaultSolrUrl())
+ .path("solr")
Review Comment:
That is a good question. Eventually out of context of this PR, but a case we
should eventually test. Seems like custom contexts in general may not have been
tested and documented enough.
--
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]