Skip to content

Apache Lucene open-source search software

SOLR-2631: PingRequestHandler should not allow to ping itsself using "qt" param to prevent infinite loop

Uwe Schindlerd0ab5f6174c6
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 549700e741f..b4c20e02260 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -297,6 +297,9 @@ Bug Fixes
* SOLR-2625: TermVectorComponent throws NPE if TF-IDF option is used without DF
option. (Daniel Erenrich, Simon Willnauer)
+* SOLR-2631: PingRequestHandler should not allow to ping itsself using "qt"
+ param to prevent infinite loop. (Edoardo Tosca, Uwe Schindler)
+
Other Changes
----------------------
diff --git a/solr/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/src/java/org/apache/solr/handler/PingRequestHandler.java
index bb5aed01fc0..81a1594ee93 100644
--- a/solr/src/java/org/apache/solr/handler/PingRequestHandler.java
+++ b/solr/src/java/org/apache/solr/handler/PingRequestHandler.java
@@ -56,6 +56,11 @@ public class PingRequestHandler extends RequestHandlerBase
"Unknown RequestHandler: "+qt );
}
+ if( handler instanceof PingRequestHandler ) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "Cannot execute the PingRequestHandler recursively" );
+ }
+
// Execute the ping query and catch any possible exception
Throwable ex = null;
try {