Skip to content

SOLR-17742: remove handleSelect requestDispatcher option #3409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ Deprecation Removals

* SOLR-17778: Removed no-op core admin operation FORCEPREPAREFORLEADERSHIP and its SolrJ peer OverrideLastPublished. (Pierre Salagnac)

* SOLR-17742: Removed the handleSelect option of <requestDispatcher>. (Gaurav Tuli)

Dependency Upgrades
---------------------

Expand Down
9 changes: 0 additions & 9 deletions solr/core/src/java/org/apache/solr/core/SolrConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public enum PluginOpts {

private int formUploadLimitKB;

private boolean handleSelect;

private final SolrRequestParsers solrRequestParsers;

/**
Expand Down Expand Up @@ -363,8 +361,6 @@ private SolrConfig(SolrResourceLoader loader, String name, Properties substituta
log.warn("Ignored deprecated enableStreamBody in config; use sys-prop");
}

handleSelect = get("requestDispatcher").boolAttr("handleSelect", false);

List<PluginInfo> argsInfos = getPluginInfos(InitParams.class.getName());
if (argsInfos != null) {
Map<String, InitParams> argsMap = new HashMap<>();
Expand Down Expand Up @@ -959,10 +955,6 @@ public int getFormUploadLimitKB() {
return formUploadLimitKB;
}

public boolean isHandleSelect() {
return handleSelect;
}

@Override
public Map<String, Object> toMap(Map<String, Object> result) {
if (znodeVersion > -1) result.put(ZNODEVER, znodeVersion);
Expand Down Expand Up @@ -1010,7 +1002,6 @@ public Map<String, Object> toMap(Map<String, Object> result) {
m, filterCacheConfig, queryResultCacheConfig, documentCacheConfig, fieldValueCacheConfig);
m = new LinkedHashMap<>();
result.put("requestDispatcher", m);
m.put("handleSelect", handleSelect);
if (httpCachingConfig != null) m.put("httpCaching", httpCachingConfig);
m.put(
"requestParsers",
Expand Down
21 changes: 0 additions & 21 deletions solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.ContentStreamHandlerBase;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
Expand Down Expand Up @@ -453,26 +452,6 @@ protected List<String> resolveCollectionListOrAlias(String collectionStr) {
protected void extractHandlerFromURLPath(SolrRequestParsers parser) throws Exception {
if (handler == null && path.length() > 1) { // don't match "" or "/" as valid path
handler = core.getRequestHandler(path);
// no handler yet but <requestDispatcher> allows us to handle /select with a 'qt' param
if (handler == null && parser.isHandleSelect()) {
if ("/select".equals(path) || "/select/".equals(path)) {
solrReq = parser.parse(core, path, req);
String qt = solrReq.getParams().get(CommonParams.QT);
handler = core.getRequestHandler(qt);
if (handler == null) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "unknown handler: " + qt);
}
if (qt != null && qt.startsWith("/") && (handler instanceof ContentStreamHandlerBase)) {
// For security reasons it's a bad idea to allow a leading '/', ex: /select?qt=/update
// see SOLR-3161
// There was no restriction from Solr 1.4 thru 3.5 and it's not supported for update
// handlers.
throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST,
"Invalid Request Handler ('qt'). Do not use /select to access: " + qt);
}
}
}
}
}

Expand Down
15 changes: 3 additions & 12 deletions solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public class SolrRequestParsers {
private final boolean enableRemoteStreams;
private final boolean enableStreamBody;
private StandardRequestParser standard;
private boolean handleSelect = true;

/**
* Default instance for e.g. admin requests. Limits to 2 MB uploads and does not allow remote
Expand All @@ -104,7 +103,7 @@ public SolrRequestParsers(SolrConfig globalConfig) {
multipartUploadLimitKB = formUploadLimitKB = Integer.MAX_VALUE;
enableRemoteStreams = false;
enableStreamBody = false;
handleSelect = false;

} else {
multipartUploadLimitKB = globalConfig.getMultipartUploadLimitKB();

Expand All @@ -115,15 +114,15 @@ public SolrRequestParsers(SolrConfig globalConfig) {
enableStreamBody = Boolean.getBoolean("solr.enableStreamBody");

// Let this filter take care of /select?xxx format
handleSelect = globalConfig.isHandleSelect();

}
init(multipartUploadLimitKB, formUploadLimitKB);
}

private SolrRequestParsers() {
enableRemoteStreams = false;
enableStreamBody = false;
handleSelect = false;

init(Integer.MAX_VALUE, Integer.MAX_VALUE);
}

Expand Down Expand Up @@ -516,14 +515,6 @@ private static int digit16(int b) {
"URLDecoder: Invalid digit (" + ((char) b) + ") in escape (%) pattern");
}

public boolean isHandleSelect() {
return handleSelect;
}

public void setHandleSelect(boolean handleSelect) {
this.handleSelect = handleSelect;
}

public boolean isEnableRemoteStreams() {
return enableRemoteStreams;
}
Expand Down
Loading