Apache Lucene open-source search software
SOLR-7500: Remove pathPrefix from SolrDispatchFilter as Solr no longer runs as a part of a bigger webapp.
Anshum Gupta2cec2feec80f
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 62888ed5df3..84e673a5352 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -107,6 +107,10 @@ Upgrading from Solr 5.1- Please refer to the "Enabling SSL" section in the Solr Reference Guide for complete details.+* Support for pathPrefix has been completely removed from Solr. Since 5.0, Solr only officially+ supported being run as a webapp but you could play around with the web.xml to have a path prefix.+ That would no longer be true. See SOLR-7500 for more info.+Detailed Change List----------------------@@ -327,6 +331,9 @@ Other Changes* SOLR-7102: bin/solr should activate cloud mode if ZK_HOST is set (Timothy Potter)+* SOLR-7500: Remove pathPrefix from SolrDispatchFilter as Solr no longer runs as a part+ of a bigger webapp. (Anshum Gupta)+================== 5.1.0 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this releasediff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.javaindex 55e3b9e8215..06f0c7e1db0 100644--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java@@ -145,9 +145,6 @@ class HttpSolrCall {// this lets you handle /update/commit when /update is a servletpath += req.getPathInfo();}- if (solrDispatchFilter.pathPrefix != null && path.startsWith(solrDispatchFilter.pathPrefix)) {- path = path.substring(solrDispatchFilter.pathPrefix.length());- }// check for management pathString alternate = cores.getManagementPath();if (alternate != null && path.startsWith(alternate)) {diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.javaindex da55cb1c0bc..64982d55104 100644--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java@@ -84,9 +84,6 @@ public class SolrDispatchFilter extends BaseSolrFilter {log.info("SolrDispatchFilter.init()" + this.getClass().getClassLoader());try {- // web.xml configuration- this.pathPrefix = config.getInitParameter( "path-prefix" );-Properties extraProperties = (Properties) config.getServletContext().getAttribute(PROPERTIES_ATTRIBUTE);if (extraProperties == null)extraProperties = new Properties();@@ -192,43 +189,4 @@ public class SolrDispatchFilter extends BaseSolrFilter {call.destroy();}}---- // TODO: Clean up - we don't need this anymore.- //---------------------------------------------------------------------- //----------------------------------------------------------------------- /**- * Set the prefix for all paths. This is useful if you want to apply the- * filter to something other then /*, perhaps because you are merging this- * filter into a larger web application.- *- * For example, if web.xml specifies:- * <pre class="prettyprint">- * {@code- * <filter-mapping>- * <filter-name>SolrRequestFilter</filter-name>- * <url-pattern>/xxx/*</url-pattern>- * </filter-mapping>}- * </pre>- *- * Make sure to set the PathPrefix to "/xxx" either with this function- * or in web.xml.- *- * <pre class="prettyprint">- * {@code- * <init-param>- * <param-name>path-prefix</param-name>- * <param-value>/xxx</param-value>- * </init-param>}- * </pre>- */- public void setPathPrefix(String pathPrefix) {- this.pathPrefix = pathPrefix;- }-- public String getPathPrefix() {- return pathPrefix;- }}