jdyer1 commented on code in PR #2454:
URL: https://github.com/apache/solr/pull/2454#discussion_r1605174654
##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java:
##########
@@ -299,10 +299,19 @@ private PreparedRequest preparePutOrPost(
InputStream is = streams.iterator().next().getStream();
bodyPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> is);
} else if (queryParams != null && urlParamNames != null) {
- ModifiableSolrParams requestParams = queryParams;
- queryParams = calculateQueryParams(urlParamNames, requestParams);
- queryParams.add(calculateQueryParams(solrRequest.getQueryParams(),
requestParams));
- bodyPublisher =
HttpRequest.BodyPublishers.ofString(requestParams.toString());
+ // move params specified in urlParamNames from queryParams into urlParams
+ ModifiableSolrParams urlParams = calculateQueryParams(urlParamNames,
queryParams);
+
+ // note this is only triggered if urlParamNames is set too - this this
correct?
+ urlParams.add(calculateQueryParams(solrRequest.getQueryParams(),
queryParams));
Review Comment:
Well, you are right, it does not seem urlParams or queryParams can ever be
null. So you're correct, the "noBody" case never gets touched. I guess I had
thought there would be a case where we would could post with an empty body but
clearly this cannot happen.
--
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]