This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 6c793d55341 SolrRequest.getPath setPath documentation (#4665)
6c793d55341 is described below
commit 6c793d5534160d882882f2833496ae25c1f9016b
Author: David Smiley <[email protected]>
AuthorDate: Wed Jul 29 00:26:53 2026 -0400
SolrRequest.getPath setPath documentation (#4665)
And path enforcement
---
.../solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
index 0f2b21b7f85..7574bd38967 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
@@ -172,11 +172,20 @@ public abstract class SolrRequest<T> implements
Serializable {
this.method = method;
}
+ /**
+ * The URI path to a "request handler", such as "/select". Must start with a
"/". For
+ * collection/core requests, this is appended to the core/collection path;
otherwise it's a node
+ * level request and thus is relative to the solr root.
+ */
public String getPath() {
return path;
}
public void setPath(String path) {
+ if (path == null || !path.startsWith("/")) {
+ throw new IllegalArgumentException("Must start with a '/': " + path);
+ }
+
this.path = path;
}