dsmiley commented on code in PR #3442:
URL: https://github.com/apache/solr/pull/3442#discussion_r2234053079


##########
solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java:
##########
@@ -79,4 +82,31 @@ public void testUrlBuilding() throws Exception {
       assertEquals("http://localhost:8983/solr/admin/info/health";, url);
     }
   }
+
+  @Test
+  public void testQueryRequestQtParameterRemoval() {
+    SolrQuery query = new SolrQuery("*:*");
+    query.setRequestHandler("/custom");
+
+    QueryRequest request = new QueryRequest(query);
+
+    assertEquals("/custom", request.getPath());
+
+    SolrParams params = request.getParams();
+    assertNull("qt parameter should be removed from request params", 
params.get(CommonParams.QT));
+    assertEquals("*:*", params.get(CommonParams.Q));
+  }
+
+  @Test
+  public void testQueryRequestQtParameterWithoutSlash() {
+    SolrQuery query = new SolrQuery("*:*");
+    query.setRequestHandler("custom"); // no leading slash
+
+    QueryRequest request = new QueryRequest(query);
+
+    assertEquals("/select", request.getPath());
+
+    SolrParams params = request.getParams();
+    assertNull("qt parameter should be removed from request params", 
params.get(CommonParams.QT));

Review Comment:
   
https://github.com/apache/solr/blob/50655d0e1b275a4c10d2b9b3a8a6c1d850178643/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java#L457



-- 
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]

Reply via email to