Skip to content

Commit 58e660b

Browse files
Copilotdsmiley
andcommitted
SOLR-14687: childPath starting with / is BAD_REQUEST; empty childPath == no childPath
Co-authored-by: dsmiley <377295+dsmiley@users.noreply.github.com>
1 parent 68df578 commit 58e660b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

solr/core/src/java/org/apache/solr/search/join/BlockJoinParentQParser.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,12 @@ protected Query parseUsingParentPath(String parentPath) throws SyntaxError {
150150

151151
String childPath = localParams.get(CHILD_PATH_PARAM);
152152
if (childPath != null) {
153-
// strip leading slash if present
154153
if (childPath.startsWith("/")) {
155-
childPath = childPath.substring(1);
154+
throw new SolrException(
155+
SolrException.ErrorCode.BAD_REQUEST, CHILD_PATH_PARAM + " must not start with '/'");
156156
}
157157
if (childPath.isEmpty()) {
158-
throw new SolrException(
159-
SolrException.ErrorCode.BAD_REQUEST, CHILD_PATH_PARAM + " must not be empty");
158+
childPath = null; // treat empty as not specified
160159
}
161160
}
162161

0 commit comments

Comments
 (0)