MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r419210970



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default 
is false
+  private static final boolean disabled = 
Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse 
_response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, 
false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, 
false);
-    
+
+    if(disabled){

Review comment:
       Handling the raw response works better. Looking at the snippet on this 
page originally I didn't have the full context. Good suggestion. Thanks 👍 




----------------------------------------------------------------
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.

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



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

Reply via email to