Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public String getBasicAuthPassword() {

public SolrRequest(METHOD m, String path, SolrRequestType requestType) {
this.method = m;
this.path = path;
this.path = validatePath(path);
this.requestType = requestType;
}

Expand All @@ -182,11 +182,14 @@ public String getPath() {
}

public void setPath(String path) {
if (path == null || !path.startsWith("/")) {
this.path = validatePath(path);
}

private static String validatePath(String path) {
if (path != null && !path.startsWith("/")) {
throw new IllegalArgumentException("Must start with a '/': " + path);
}

this.path = path;
return path;
}

/**
Expand Down
Loading