jdyer1 commented on code in PR #2454:
URL: https://github.com/apache/solr/pull/2454#discussion_r1597202970


##########
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:
   Indeed `urlParamNames` is never null (see `HttpSolrClientBase` constructor 
line 107ff), so the null check is spurious.  Should you comment-out line 306, 
you will see `testQueryString` fail in the case where there are query 
parameters but nothing was set for `urlParamNames` (using the 
`withTheseParamNamesInTheUrl` option).



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to