dsmiley commented on a change in pull request #397:
URL: https://github.com/apache/solr/pull/397#discussion_r744390463



##########
File path: solr/core/src/java/org/apache/solr/servlet/ServletUtils.java
##########
@@ -122,6 +126,38 @@ public void close() {
     }
   }
 
+  static boolean excludedPath(ArrayList<Pattern> excludePatterns, 
HttpServletRequest request, HttpServletResponse response, FilterChain chain) 
throws IOException, ServletException {

Review comment:
       ArrayList -> List

##########
File path: solr/core/src/java/org/apache/solr/servlet/PathExcluder.java
##########
@@ -0,0 +1,8 @@
+package org.apache.solr.servlet;
+
+import java.util.ArrayList;
+import java.util.regex.Pattern;
+
+public interface PathExcluder {

Review comment:
       Do we really need this?  And I wonder if "excludePatterns" is a feature 
that like one person/company uses.

##########
File path: solr/webapp/web/WEB-INF/web.xml
##########
@@ -42,6 +42,16 @@
     <url-pattern>/*</url-pattern>
   </filter-mapping>
 
+  <servlet>
+    <servlet-name>AdminServlet</servlet-name>
+    <servlet-class>org.apache.solr.servlet.AdminServlet</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>AdminServlet</servlet-name>
+    <url-pattern>/admin2</url-pattern>

Review comment:
       huh?

##########
File path: solr/core/src/java/org/apache/solr/servlet/ServletUtils.java
##########
@@ -122,6 +126,38 @@ public void close() {
     }
   }
 
+  static boolean excludedPath(ArrayList<Pattern> excludePatterns, 
HttpServletRequest request, HttpServletResponse response, FilterChain chain) 
throws IOException, ServletException {
+    String requestPath = getPathAfterContext(request);
+    // No need to even create the HttpSolrCall object if this path is excluded.
+    if (excludePatterns != null) {
+      for (Pattern p : excludePatterns) {
+        Matcher matcher = p.matcher(requestPath);
+        if (matcher.lookingAt()) {
+          if (chain != null) {
+            chain.doFilter(request, response);
+          }
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  static boolean excludedPath(ArrayList<Pattern> excludePatterns, 
HttpServletRequest request, HttpServletResponse response) throws IOException, 
ServletException {

Review comment:
       ArrayList -> List

##########
File path: solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
##########
@@ -106,6 +107,12 @@
   protected String abortErrorMessage = null;
   //TODO using Http2Client
   protected HttpClient httpClient;
+
+  @Override
+  public void setExcludePatterns(ArrayList<Pattern> excludePatterns) {

Review comment:
       ArrayList -> List

##########
File path: solr/core/src/java/org/apache/solr/servlet/CoreContainerProvider.java
##########
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.servlet;
+
+import org.apache.solr.core.CoreContainer;
+
+public interface CoreContainerProvider {

Review comment:
       Wouldn't Suppler<CoreContainer> suffice?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to